// /*************************************************************************** // Aaru Data Preservation Suite // ---------------------------------------------------------------------------- // // Filename : Structs.cs // Author(s) : Natalia Portillo // // Component : Disk image plugins. // // --[ Description ] ---------------------------------------------------------- // // Contains structures for Sydex CopyQM disk 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-2021 Natalia Portillo // ****************************************************************************/ using System.Runtime.InteropServices; namespace Aaru.DiscImages { public sealed partial class CopyQm { [StructLayout(LayoutKind.Sequential, Pack = 1)] readonly struct Header { /// 0x00 magic, "CQ" public readonly ushort magic; /// 0x02 always 0x14 public readonly byte mark; /// 0x03 Bytes per sector (part of FAT's BPB) public readonly ushort sectorSize; /// 0x05 Sectors per cluster (part of FAT's BPB) public readonly byte sectorPerCluster; /// 0x06 Reserved sectors (part of FAT's BPB) public readonly ushort reservedSectors; /// 0x08 Number of FAT copies (part of FAT's BPB) public readonly byte fatCopy; /// 0x09 Maximum number of entries in root directory (part of FAT's BPB) public readonly ushort rootEntries; /// 0x0B Sectors on disk (part of FAT's BPB) public readonly ushort sectors; /// 0x0D Media descriptor (part of FAT's BPB) public readonly byte mediaType; /// 0x0E Sectors per FAT (part of FAT's BPB) public readonly ushort sectorsPerFat; /// 0x10 Sectors per track (part of FAT's BPB) public readonly ushort sectorsPerTrack; /// 0x12 Heads (part of FAT's BPB) public readonly ushort heads; /// 0x14 Hidden sectors (part of FAT's BPB) public readonly uint hidden; /// 0x18 Sectors on disk (part of FAT's BPB) public readonly uint sectorsBig; /// 0x1C Description [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 60)] public readonly string description; /// 0x58 Blind mode. 0 = DOS, 1 = blind, 2 = HFS public readonly byte blind; /// 0x59 Density. 0 = Double, 1 = High, 2 = Quad/Extra public readonly byte density; /// 0x5A Cylinders in image public readonly byte imageCylinders; /// 0x5B Cylinders on disk public readonly byte totalCylinders; /// 0x5C CRC32 of data public readonly uint crc; /// 0x60 DOS volume label [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 11)] public readonly string volumeLabel; /// 0x6B Modification time public readonly ushort time; /// 0x6D Modification date public readonly ushort date; /// 0x6F Comment length public readonly ushort commentLength; /// 0x71 Sector base (first sector - 1) public readonly byte secbs; /// 0x72 Unknown public readonly ushort unknown; /// 0x74 Interleave public readonly byte interleave; /// 0x75 Skew public readonly byte skew; /// 0x76 Source drive type. 1 = 5.25" DD, 2 = 5.25" HD, 3 = 3.5" DD, 4 = 3.5" HD, 6 = 3.5" ED public readonly byte drive; /// 0x77 Filling bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 13)] public readonly byte[] fill; /// 0x84 Header checksum public readonly byte headerChecksum; } } }