// /*************************************************************************** // Aaru Data Preservation Suite // ---------------------------------------------------------------------------- // // Filename : Structs.cs // Author(s) : Natalia Portillo // // Component : Disk image plugins. // // --[ Description ] ---------------------------------------------------------- // // Contains structures for Nero Burning ROM disc images. // // --[ 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.Collections.Generic; using System.Diagnostics.CodeAnalysis; // ReSharper disable NotAccessedField.Local namespace Aaru.DiscImages { [SuppressMessage("ReSharper", "UnusedType.Local")] public sealed partial class Nero { struct FooterV1 { /// "NERO" public uint ChunkId; /// Offset of first chunk in file public uint FirstChunkOffset; } struct FooterV2 { /// "NER5" public uint ChunkId; /// Offset of first chunk in file public ulong FirstChunkOffset; } struct CueEntryV2 { /// Track mode. 0x01 for audio, 0x21 for copy-protected audio, 0x41 for data public byte Mode; /// Track number in BCD public byte TrackNumber; /// Index number in BCD public byte IndexNumber; /// Always zero public byte Dummy; /// LBA sector start for this entry public int LbaStart; } class CuesheetV2 { /// "CUEX" public uint ChunkId; /// Chunk size public uint ChunkSize; /// Cuesheet entries public List Entries; } struct CueEntryV1 { /// Track mode. 0x01 for audio, 0x21 for copy-protected audio, 0x41 for data public byte Mode; /// Track number in BCD public byte TrackNumber; /// Index number in BCD public byte IndexNumber; /// Always zero public ushort Dummy; /// MSF start sector's minute for this entry public byte Minute; /// MSF start sector's second for this entry public byte Second; /// MSF start sector's frame for this entry public byte Frame; } class CuesheetV1 { /// "CUES" public uint ChunkId; /// Chunk size public uint ChunkSize; /// Cuesheet entries public List Entries; } struct DaoEntryV1 { /// ISRC (12 bytes) public byte[] Isrc; /// Size of sector inside image (in bytes) public ushort SectorSize; /// Sector mode in image public ushort Mode; /// Unknown public ushort Unknown; /// Index 0 start public uint Index0; /// Index 1 start public uint Index1; /// End of track + 1 public uint EndOfTrack; } struct DaoV1 { /// "DAOI" public uint ChunkId; /// Chunk size (big endian) public uint ChunkSizeBe; /// Chunk size (little endian) public uint ChunkSizeLe; /// UPC (14 bytes, null-padded) public byte[] Upc; /// TOC type public ushort TocType; /// First track public byte FirstTrack; /// Last track public byte LastTrack; /// Tracks public List Tracks; } struct DaoEntryV2 { /// ISRC (12 bytes) public byte[] Isrc; /// Size of sector inside image (in bytes) public ushort SectorSize; /// Sector mode in image public ushort Mode; /// Seems to be always 0. public ushort Unknown; /// Index 0 start public ulong Index0; /// Index 1 start public ulong Index1; /// End of track + 1 public ulong EndOfTrack; } struct DaoV2 { /// "DAOX" public uint ChunkId; /// Chunk size (big endian) public uint ChunkSizeBe; /// Chunk size (little endian) public uint ChunkSizeLe; /// UPC (14 bytes, null-padded) public byte[] Upc; /// TOC type public ushort TocType; /// First track public byte FirstTrack; /// Last track public byte LastTrack; /// Tracks public List Tracks; } struct CdTextPack { /// Pack type public byte PackType; /// Track number public byte TrackNumber; /// Pack number in block public byte PackNumber; /// Block number public byte BlockNumber; /// 12 bytes of data public byte[] Text; /// CRC public ushort Crc; } struct CdText { /// "CDTX" public uint ChunkId; /// Chunk size public uint ChunkSize; /// CD-TEXT packs public List Packs; } struct TaoEntryV1 { /// Offset of track on image public uint Offset; /// Length of track in bytes public uint Length; /// Track mode public uint Mode; /// LBA track start (plus 150 lead in sectors) public uint StartLba; /// Unknown public uint Unknown; } struct TaoV1 { /// "ETNF" public uint ChunkId; /// Chunk size public uint ChunkSize; /// CD-TEXT packs public List Tracks; } struct TaoEntryV2 { /// Offset of track on image public ulong Offset; /// Length of track in bytes public ulong Length; /// Track mode public uint Mode; /// LBA track start (plus 150 lead in sectors) public uint StartLba; /// Unknown public uint Unknown; /// Track length in sectors public uint Sectors; } struct TaoV2 { /// "ETN2" public uint ChunkId; /// Chunk size public uint ChunkSize; /// CD-TEXT packs public List Tracks; } struct Session { /// "SINF" public uint ChunkId; /// Chunk size public uint ChunkSize; /// Tracks in session public uint Tracks; } struct MediaType { /// "MTYP" public uint ChunkId; /// Chunk size public uint ChunkSize; /// Media type public uint Type; } struct DiscInformation { /// "DINF" public uint ChunkId; /// Chunk size public uint ChunkSize; /// Unknown public uint Unknown; } struct TocChunk { /// "TOCT" public uint ChunkId; /// Chunk size public uint ChunkSize; /// Unknown public ushort Unknown; } struct ReloChunk { /// "RELO" public uint ChunkId; /// Chunk size public uint ChunkSize; /// Unknown public uint Unknown; } struct EndOfChunkChain { /// "END!" public uint ChunkId; /// Chunk size public uint ChunkSize; } // Internal use only struct NeroTrack { public byte[] Isrc; public ushort SectorSize; public ulong Offset; public ulong Length; public ulong EndOfTrack; public uint Mode; public ulong StartLba; public ulong Sectors; public ulong Index0; public ulong Index1; public uint Sequence; public bool UseLbaForIndex; } } }