2017-12-03 01:49:33 +00:00
|
|
|
|
// /***************************************************************************
|
|
|
|
|
|
// The Disc Image Chef
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// Filename : SuperCardPro.cs
|
|
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
|
//
|
2017-12-19 03:50:57 +00:00
|
|
|
|
// Component : Disk image plugins.
|
2017-12-03 01:49:33 +00:00
|
|
|
|
//
|
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
|
//
|
2017-12-19 03:50:57 +00:00
|
|
|
|
// Manages SuperCardPro flux images.
|
2017-12-03 01:49:33 +00:00
|
|
|
|
//
|
|
|
|
|
|
// --[ 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/>.
|
|
|
|
|
|
//
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2017-12-19 03:50:57 +00:00
|
|
|
|
// Copyright © 2011-2018 Natalia Portillo
|
2017-12-03 01:49:33 +00:00
|
|
|
|
// ****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.Linq;
|
|
|
|
|
|
using System.Runtime.InteropServices;
|
2017-12-05 20:38:47 +00:00
|
|
|
|
using System.Text;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
using DiscImageChef.CommonTypes;
|
|
|
|
|
|
using DiscImageChef.Console;
|
|
|
|
|
|
using DiscImageChef.Filters;
|
|
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
|
namespace DiscImageChef.DiscImages
|
2017-12-03 01:49:33 +00:00
|
|
|
|
{
|
2017-12-19 20:33:03 +00:00
|
|
|
|
public class SuperCardPro : ImagePlugin
|
2017-12-03 01:49:33 +00:00
|
|
|
|
{
|
|
|
|
|
|
public enum ScpDiskType : byte
|
|
|
|
|
|
{
|
|
|
|
|
|
Commodore64 = 0x00,
|
|
|
|
|
|
CommodoreAmiga = 0x04,
|
|
|
|
|
|
AtariFMSS = 0x10,
|
|
|
|
|
|
AtariFMDS = 0x11,
|
|
|
|
|
|
AtariFSEx = 0x12,
|
|
|
|
|
|
AtariSTSS = 0x14,
|
|
|
|
|
|
AtariSTDS = 0x15,
|
|
|
|
|
|
AppleII = 0x20,
|
|
|
|
|
|
AppleIIPro = 0x21,
|
|
|
|
|
|
Apple400K = 0x24,
|
|
|
|
|
|
Apple800K = 0x25,
|
|
|
|
|
|
Apple144 = 0x26,
|
|
|
|
|
|
PC360K = 0x30,
|
|
|
|
|
|
PC720K = 0x31,
|
|
|
|
|
|
PC12M = 0x32,
|
|
|
|
|
|
PC144M = 0x33,
|
|
|
|
|
|
TandySSSD = 0x40,
|
|
|
|
|
|
TandySSDD = 0x41,
|
|
|
|
|
|
TandyDSSD = 0x42,
|
|
|
|
|
|
TandyDSDD = 0x43,
|
|
|
|
|
|
Ti994A = 0x50,
|
|
|
|
|
|
RolandD20 = 0x60
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Flags]
|
|
|
|
|
|
public enum ScpFlags : byte
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
2017-12-24 00:12:31 +00:00
|
|
|
|
/// If set flux starts at index pulse
|
2017-12-03 01:49:33 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
Index = 0x00,
|
|
|
|
|
|
/// <summary>
|
2017-12-24 00:12:31 +00:00
|
|
|
|
/// If set drive is 96tpi
|
2017-12-03 01:49:33 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
Tpi = 0x02,
|
|
|
|
|
|
/// <summary>
|
2017-12-24 00:12:31 +00:00
|
|
|
|
/// If set drive is 360rpm
|
2017-12-03 01:49:33 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
Rpm = 0x04,
|
|
|
|
|
|
/// <summary>
|
2017-12-24 00:12:31 +00:00
|
|
|
|
/// If set image contains normalized data
|
2017-12-03 01:49:33 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
Normalized = 0x08,
|
|
|
|
|
|
/// <summary>
|
2017-12-24 00:12:31 +00:00
|
|
|
|
/// If set image is read/write capable
|
2017-12-03 01:49:33 +00:00
|
|
|
|
/// </summary>
|
2017-12-05 20:38:47 +00:00
|
|
|
|
Writable = 0x10,
|
|
|
|
|
|
/// <summary>
|
2017-12-24 00:12:31 +00:00
|
|
|
|
/// If set, image has footer
|
2017-12-05 20:38:47 +00:00
|
|
|
|
/// </summary>
|
2017-12-21 02:52:12 +00:00
|
|
|
|
HasFooter = 0x20
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-12-24 00:12:31 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// SuperCardPro footer signature: "FPCS"
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
const uint FOOTER_SIGNATURE = 0x53435046;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// SuperCardPro header signature: "SCP"
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
readonly byte[] scpSignature = {0x53, 0x43, 0x50};
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// SuperCardPro track header signature: "TRK"
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
readonly byte[] trkSignature = {0x54, 0x52, 0x4B};
|
|
|
|
|
|
|
2017-12-03 01:49:33 +00:00
|
|
|
|
// TODO: These variables have been made public so create-sidecar can access to this information until I define an API >4.0
|
2017-12-20 17:15:26 +00:00
|
|
|
|
public ScpHeader Header;
|
2017-12-06 01:31:37 +00:00
|
|
|
|
Stream scpStream;
|
2017-12-24 00:12:31 +00:00
|
|
|
|
public Dictionary<byte, TrackHeader> Tracks;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
|
|
|
|
|
|
public SuperCardPro()
|
|
|
|
|
|
{
|
|
|
|
|
|
Name = "SuperCardPro";
|
2017-12-20 17:15:26 +00:00
|
|
|
|
PluginUuid = new Guid("C5D3182E-1D45-4767-A205-E6E5C83444DC");
|
2017-12-21 03:18:10 +00:00
|
|
|
|
ImageInfo = new ImageInfo
|
2017-12-03 01:49:33 +00:00
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
ReadableSectorTags = new List<SectorTagType>(),
|
|
|
|
|
|
ReadableMediaTags = new List<MediaTagType>(),
|
|
|
|
|
|
ImageHasPartitions = false,
|
|
|
|
|
|
ImageHasSessions = false,
|
|
|
|
|
|
ImageVersion = null,
|
|
|
|
|
|
ImageApplication = null,
|
|
|
|
|
|
ImageApplicationVersion = null,
|
|
|
|
|
|
ImageCreator = null,
|
|
|
|
|
|
ImageComments = null,
|
|
|
|
|
|
MediaManufacturer = null,
|
|
|
|
|
|
MediaModel = null,
|
|
|
|
|
|
MediaSerialNumber = null,
|
|
|
|
|
|
MediaBarcode = null,
|
|
|
|
|
|
MediaPartNumber = null,
|
|
|
|
|
|
MediaSequence = 0,
|
|
|
|
|
|
LastMediaSequence = 0,
|
|
|
|
|
|
DriveManufacturer = null,
|
|
|
|
|
|
DriveModel = null,
|
|
|
|
|
|
DriveSerialNumber = null,
|
|
|
|
|
|
DriveFirmwareRevision = null
|
2017-12-03 01:49:33 +00:00
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override bool IdentifyImage(Filter imageFilter)
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
Header = new ScpHeader();
|
2017-12-03 01:49:33 +00:00
|
|
|
|
Stream stream = imageFilter.GetDataForkStream();
|
|
|
|
|
|
stream.Seek(0, SeekOrigin.Begin);
|
2017-12-20 17:15:26 +00:00
|
|
|
|
if(stream.Length < Marshal.SizeOf(Header)) return false;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
|
byte[] hdr = new byte[Marshal.SizeOf(Header)];
|
|
|
|
|
|
stream.Read(hdr, 0, Marshal.SizeOf(Header));
|
2017-12-03 01:49:33 +00:00
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
|
IntPtr hdrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(Header));
|
|
|
|
|
|
Marshal.Copy(hdr, 0, hdrPtr, Marshal.SizeOf(Header));
|
|
|
|
|
|
Header = (ScpHeader)Marshal.PtrToStructure(hdrPtr, typeof(ScpHeader));
|
2017-12-03 01:49:33 +00:00
|
|
|
|
Marshal.FreeHGlobal(hdrPtr);
|
|
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return scpSignature.SequenceEqual(Header.signature);
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override bool OpenImage(Filter imageFilter)
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
Header = new ScpHeader();
|
2017-12-06 01:31:37 +00:00
|
|
|
|
scpStream = imageFilter.GetDataForkStream();
|
|
|
|
|
|
scpStream.Seek(0, SeekOrigin.Begin);
|
2017-12-20 17:15:26 +00:00
|
|
|
|
if(scpStream.Length < Marshal.SizeOf(Header)) return false;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
|
byte[] hdr = new byte[Marshal.SizeOf(Header)];
|
|
|
|
|
|
scpStream.Read(hdr, 0, Marshal.SizeOf(Header));
|
2017-12-03 01:49:33 +00:00
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
|
IntPtr hdrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(Header));
|
|
|
|
|
|
Marshal.Copy(hdr, 0, hdrPtr, Marshal.SizeOf(Header));
|
|
|
|
|
|
Header = (ScpHeader)Marshal.PtrToStructure(hdrPtr, typeof(ScpHeader));
|
2017-12-03 01:49:33 +00:00
|
|
|
|
Marshal.FreeHGlobal(hdrPtr);
|
|
|
|
|
|
|
2017-12-19 20:33:03 +00:00
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "header.signature = \"{0}\"",
|
2017-12-20 17:15:26 +00:00
|
|
|
|
StringHandlers.CToString(Header.signature));
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "header.version = {0}.{1}", (Header.version & 0xF0) >> 4,
|
|
|
|
|
|
Header.version & 0xF);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "header.type = {0}", Header.type);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "header.revolutions = {0}", Header.revolutions);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "header.start = {0}", Header.start);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "header.end = {0}", Header.end);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "header.flags = {0}", Header.flags);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "header.bitCellEncoding = {0}", Header.bitCellEncoding);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "header.heads = {0}", Header.heads);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "header.reserved = {0}", Header.reserved);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "header.checksum = 0x{0:X8}", Header.checksum);
|
|
|
|
|
|
|
|
|
|
|
|
if(!scpSignature.SequenceEqual(Header.signature)) return false;
|
|
|
|
|
|
|
|
|
|
|
|
Tracks = new Dictionary<byte, TrackHeader>();
|
|
|
|
|
|
|
|
|
|
|
|
for(byte t = Header.start; t <= Header.end; t++)
|
2017-12-03 01:49:33 +00:00
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
if(t >= Header.offsets.Length) break;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
|
scpStream.Position = Header.offsets[t];
|
2017-12-22 06:55:04 +00:00
|
|
|
|
TrackHeader trk =
|
|
|
|
|
|
new TrackHeader {Signature = new byte[3], Entries = new TrackEntry[Header.revolutions]};
|
2017-12-20 17:15:26 +00:00
|
|
|
|
scpStream.Read(trk.Signature, 0, trk.Signature.Length);
|
|
|
|
|
|
trk.TrackNumber = (byte)scpStream.ReadByte();
|
2017-12-03 01:49:33 +00:00
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
|
if(!trk.Signature.SequenceEqual(trkSignature))
|
2017-12-03 01:49:33 +00:00
|
|
|
|
{
|
2017-12-19 20:33:03 +00:00
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin",
|
2017-12-20 17:15:26 +00:00
|
|
|
|
"Track header at {0} contains incorrect signature.", Header.offsets[t]);
|
2017-12-03 01:49:33 +00:00
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
|
if(trk.TrackNumber != t)
|
2017-12-03 01:49:33 +00:00
|
|
|
|
{
|
2017-12-19 20:33:03 +00:00
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "Track number at {0} should be {1} but is {2}.",
|
2017-12-20 17:15:26 +00:00
|
|
|
|
Header.offsets[t], t, trk.TrackNumber);
|
2017-12-03 01:49:33 +00:00
|
|
|
|
continue;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "Found track {0} at {1}.", t, Header.offsets[t]);
|
2017-12-03 01:49:33 +00:00
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
|
for(byte r = 0; r < Header.revolutions; r++)
|
2017-12-03 01:49:33 +00:00
|
|
|
|
{
|
|
|
|
|
|
byte[] rev = new byte[Marshal.SizeOf(typeof(TrackEntry))];
|
2017-12-06 01:31:37 +00:00
|
|
|
|
scpStream.Read(rev, 0, Marshal.SizeOf(typeof(TrackEntry)));
|
2017-12-03 01:49:33 +00:00
|
|
|
|
|
|
|
|
|
|
IntPtr revPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(TrackEntry)));
|
|
|
|
|
|
Marshal.Copy(rev, 0, revPtr, Marshal.SizeOf(typeof(TrackEntry)));
|
2017-12-20 17:15:26 +00:00
|
|
|
|
trk.Entries[r] = (TrackEntry)Marshal.PtrToStructure(revPtr, typeof(TrackEntry));
|
2017-12-03 01:49:33 +00:00
|
|
|
|
Marshal.FreeHGlobal(revPtr);
|
|
|
|
|
|
// De-relative offsets
|
2017-12-20 17:15:26 +00:00
|
|
|
|
trk.Entries[r].dataOffset += Header.offsets[t];
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
|
Tracks.Add(t, trk);
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
|
if(Header.flags.HasFlag(ScpFlags.HasFooter))
|
2017-12-05 20:38:47 +00:00
|
|
|
|
{
|
2017-12-06 01:31:37 +00:00
|
|
|
|
long position = scpStream.Position;
|
|
|
|
|
|
scpStream.Seek(-4, SeekOrigin.End);
|
2017-12-19 20:33:03 +00:00
|
|
|
|
|
2017-12-06 01:31:37 +00:00
|
|
|
|
while(scpStream.Position >= position)
|
2017-12-05 20:38:47 +00:00
|
|
|
|
{
|
|
|
|
|
|
byte[] footerSig = new byte[4];
|
2017-12-06 01:31:37 +00:00
|
|
|
|
scpStream.Read(footerSig, 0, 4);
|
2017-12-05 20:38:47 +00:00
|
|
|
|
uint footerMagic = BitConverter.ToUInt32(footerSig, 0);
|
|
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
|
if(footerMagic == FOOTER_SIGNATURE)
|
2017-12-05 20:38:47 +00:00
|
|
|
|
{
|
2017-12-06 01:31:37 +00:00
|
|
|
|
scpStream.Seek(-Marshal.SizeOf(typeof(ScpFooter)), SeekOrigin.Current);
|
2017-12-19 20:33:03 +00:00
|
|
|
|
|
2017-12-06 01:31:37 +00:00
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "Found footer at {0}", scpStream.Position);
|
2017-12-19 20:33:03 +00:00
|
|
|
|
|
2017-12-05 20:38:47 +00:00
|
|
|
|
byte[] ftr = new byte[Marshal.SizeOf(typeof(ScpFooter))];
|
2017-12-06 01:31:37 +00:00
|
|
|
|
scpStream.Read(ftr, 0, Marshal.SizeOf(typeof(ScpFooter)));
|
2017-12-05 20:38:47 +00:00
|
|
|
|
|
|
|
|
|
|
IntPtr ftrPtr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(ScpFooter)));
|
|
|
|
|
|
Marshal.Copy(ftr, 0, ftrPtr, Marshal.SizeOf(typeof(ScpFooter)));
|
|
|
|
|
|
ScpFooter footer = (ScpFooter)Marshal.PtrToStructure(ftrPtr, typeof(ScpFooter));
|
|
|
|
|
|
Marshal.FreeHGlobal(ftrPtr);
|
|
|
|
|
|
|
2017-12-19 20:33:03 +00:00
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "footer.manufacturerOffset = 0x{0:X8}",
|
|
|
|
|
|
footer.manufacturerOffset);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "footer.modelOffset = 0x{0:X8}",
|
|
|
|
|
|
footer.modelOffset);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "footer.serialOffset = 0x{0:X8}",
|
|
|
|
|
|
footer.serialOffset);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "footer.creatorOffset = 0x{0:X8}",
|
|
|
|
|
|
footer.creatorOffset);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "footer.applicationOffset = 0x{0:X8}",
|
|
|
|
|
|
footer.applicationOffset);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "footer.commentsOffset = 0x{0:X8}",
|
|
|
|
|
|
footer.commentsOffset);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "footer.creationTime = {0}",
|
|
|
|
|
|
footer.creationTime);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "footer.modificationTime = {0}",
|
|
|
|
|
|
footer.modificationTime);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "footer.applicationVersion = {0}.{1}",
|
|
|
|
|
|
(footer.applicationVersion & 0xF0) >> 4,
|
|
|
|
|
|
footer.applicationVersion & 0xF);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "footer.hardwareVersion = {0}.{1}",
|
|
|
|
|
|
(footer.hardwareVersion & 0xF0) >> 4, footer.hardwareVersion & 0xF);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "footer.firmwareVersion = {0}.{1}",
|
|
|
|
|
|
(footer.firmwareVersion & 0xF0) >> 4, footer.firmwareVersion & 0xF);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "footer.imageVersion = {0}.{1}",
|
|
|
|
|
|
(footer.imageVersion & 0xF0) >> 4, footer.imageVersion & 0xF);
|
|
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "footer.signature = \"{0}\"",
|
|
|
|
|
|
StringHandlers.CToString(BitConverter.GetBytes(footer.signature)));
|
2017-12-05 20:38:47 +00:00
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
|
ImageInfo.DriveManufacturer = ReadPStringUtf8(scpStream, footer.manufacturerOffset);
|
|
|
|
|
|
ImageInfo.DriveModel = ReadPStringUtf8(scpStream, footer.modelOffset);
|
|
|
|
|
|
ImageInfo.DriveSerialNumber = ReadPStringUtf8(scpStream, footer.serialOffset);
|
|
|
|
|
|
ImageInfo.ImageCreator = ReadPStringUtf8(scpStream, footer.creatorOffset);
|
|
|
|
|
|
ImageInfo.ImageApplication = ReadPStringUtf8(scpStream, footer.applicationOffset);
|
|
|
|
|
|
ImageInfo.ImageComments = ReadPStringUtf8(scpStream, footer.commentsOffset);
|
2017-12-05 20:38:47 +00:00
|
|
|
|
|
2017-12-19 20:33:03 +00:00
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "ImageInfo.driveManufacturer = \"{0}\"",
|
2017-12-20 17:15:26 +00:00
|
|
|
|
ImageInfo.DriveManufacturer);
|
2017-12-19 20:33:03 +00:00
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "ImageInfo.driveModel = \"{0}\"",
|
2017-12-20 17:15:26 +00:00
|
|
|
|
ImageInfo.DriveModel);
|
2017-12-19 20:33:03 +00:00
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "ImageInfo.driveSerialNumber = \"{0}\"",
|
2017-12-20 17:15:26 +00:00
|
|
|
|
ImageInfo.DriveSerialNumber);
|
2017-12-19 20:33:03 +00:00
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "ImageInfo.imageCreator = \"{0}\"",
|
2017-12-20 17:15:26 +00:00
|
|
|
|
ImageInfo.ImageCreator);
|
2017-12-19 20:33:03 +00:00
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "ImageInfo.imageApplication = \"{0}\"",
|
2017-12-20 17:15:26 +00:00
|
|
|
|
ImageInfo.ImageApplication);
|
2017-12-19 20:33:03 +00:00
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "ImageInfo.imageComments = \"{0}\"",
|
2017-12-20 17:15:26 +00:00
|
|
|
|
ImageInfo.ImageComments);
|
2017-12-05 20:38:47 +00:00
|
|
|
|
|
2017-12-24 00:12:31 +00:00
|
|
|
|
ImageInfo.ImageCreationTime = footer.creationTime != 0
|
|
|
|
|
|
? DateHandlers.UnixToDateTime(footer.creationTime)
|
|
|
|
|
|
: imageFilter.GetCreationTime();
|
2017-12-05 20:38:47 +00:00
|
|
|
|
|
2017-12-24 00:12:31 +00:00
|
|
|
|
ImageInfo.ImageLastModificationTime =
|
|
|
|
|
|
footer.modificationTime != 0
|
|
|
|
|
|
? DateHandlers.UnixToDateTime(footer.modificationTime)
|
|
|
|
|
|
: imageFilter.GetLastWriteTime();
|
2017-12-05 20:38:47 +00:00
|
|
|
|
|
2017-12-19 20:33:03 +00:00
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "ImageInfo.imageCreationTime = {0}",
|
2017-12-20 17:15:26 +00:00
|
|
|
|
ImageInfo.ImageCreationTime);
|
2017-12-19 20:33:03 +00:00
|
|
|
|
DicConsole.DebugWriteLine("SuperCardPro plugin", "ImageInfo.imageLastModificationTime = {0}",
|
2017-12-20 17:15:26 +00:00
|
|
|
|
ImageInfo.ImageLastModificationTime);
|
2017-12-05 20:38:47 +00:00
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
|
ImageInfo.ImageApplicationVersion =
|
2017-12-21 17:58:51 +00:00
|
|
|
|
$"{(footer.applicationVersion & 0xF0) >> 4}.{footer.applicationVersion & 0xF}";
|
2017-12-20 17:15:26 +00:00
|
|
|
|
ImageInfo.DriveFirmwareRevision =
|
2017-12-21 17:58:51 +00:00
|
|
|
|
$"{(footer.firmwareVersion & 0xF0) >> 4}.{footer.firmwareVersion & 0xF}";
|
|
|
|
|
|
ImageInfo.ImageVersion = $"{(footer.imageVersion & 0xF0) >> 4}.{footer.imageVersion & 0xF}";
|
2017-12-19 20:33:03 +00:00
|
|
|
|
|
2017-12-05 20:38:47 +00:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
2017-12-19 20:33:03 +00:00
|
|
|
|
|
2017-12-06 01:31:37 +00:00
|
|
|
|
scpStream.Seek(-8, SeekOrigin.Current);
|
2017-12-05 20:38:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
ImageInfo.ImageApplication = "SuperCardPro";
|
2017-12-21 17:58:51 +00:00
|
|
|
|
ImageInfo.ImageApplicationVersion = $"{(Header.version & 0xF0) >> 4}.{Header.version & 0xF}";
|
2017-12-20 17:15:26 +00:00
|
|
|
|
ImageInfo.ImageCreationTime = imageFilter.GetCreationTime();
|
|
|
|
|
|
ImageInfo.ImageLastModificationTime = imageFilter.GetLastWriteTime();
|
|
|
|
|
|
ImageInfo.ImageVersion = "1.5";
|
2017-12-05 20:38:47 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-12-03 01:49:33 +00:00
|
|
|
|
throw new NotImplementedException("Flux decoding is not yet implemented.");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-12-22 06:55:04 +00:00
|
|
|
|
static string ReadPStringUtf8(Stream stream, uint position)
|
2017-12-05 20:38:47 +00:00
|
|
|
|
{
|
2017-12-19 20:33:03 +00:00
|
|
|
|
if(position == 0) return null;
|
2017-12-05 20:38:47 +00:00
|
|
|
|
|
|
|
|
|
|
stream.Position = position;
|
2017-12-20 17:15:26 +00:00
|
|
|
|
byte[] lenB = new byte[2];
|
|
|
|
|
|
stream.Read(lenB, 0, 2);
|
|
|
|
|
|
ushort len = BitConverter.ToUInt16(lenB, 0);
|
2017-12-05 20:38:47 +00:00
|
|
|
|
|
2017-12-19 20:33:03 +00:00
|
|
|
|
if(len == 0 || len + stream.Position >= stream.Length) return null;
|
2017-12-05 20:38:47 +00:00
|
|
|
|
|
|
|
|
|
|
byte[] str = new byte[len];
|
|
|
|
|
|
stream.Read(str, 0, len);
|
|
|
|
|
|
|
|
|
|
|
|
return Encoding.UTF8.GetString(str);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-12-03 01:49:33 +00:00
|
|
|
|
public override bool ImageHasPartitions()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.ImageHasPartitions;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override ulong GetImageSize()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.ImageSize;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override ulong GetSectors()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.Sectors;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override uint GetSectorSize()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.SectorSize;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadDiskTag(MediaTagType tag)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new NotImplementedException("Flux decoding is not yet implemented.");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSector(ulong sectorAddress)
|
|
|
|
|
|
{
|
|
|
|
|
|
return ReadSectors(sectorAddress, 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new NotImplementedException("Flux decoding is not yet implemented.");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSectors(ulong sectorAddress, uint length)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new NotImplementedException("Flux decoding is not yet implemented.");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new NotImplementedException("Flux decoding is not yet implemented.");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSectorLong(ulong sectorAddress)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new NotImplementedException("Flux decoding is not yet implemented.");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSectorLong(ulong sectorAddress, uint track)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSectorsLong(ulong sectorAddress, uint length)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new NotImplementedException("Flux decoding is not yet implemented.");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetImageFormat()
|
|
|
|
|
|
{
|
|
|
|
|
|
return "SuperCardPro";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetImageVersion()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.ImageVersion;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetImageApplication()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.ImageApplication;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetImageApplicationVersion()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.ImageApplicationVersion;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetImageCreator()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.ImageCreator;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Check if it exists. If so, read it.
|
|
|
|
|
|
public override DateTime GetImageCreationTime()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.ImageCreationTime;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override DateTime GetImageLastModificationTime()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.ImageLastModificationTime;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetImageName()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.ImageName;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetImageComments()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.ImageComments;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetMediaManufacturer()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.MediaManufacturer;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetMediaModel()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.MediaModel;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetMediaSerialNumber()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.MediaSerialNumber;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetMediaBarcode()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.MediaBarcode;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetMediaPartNumber()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.MediaPartNumber;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override MediaType GetMediaType()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.MediaType;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override int GetMediaSequence()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.MediaSequence;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override int GetLastDiskSequence()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.LastMediaSequence;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetDriveManufacturer()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.DriveManufacturer;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetDriveModel()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.DriveModel;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetDriveSerialNumber()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return ImageInfo.DriveSerialNumber;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override bool? VerifySector(ulong sectorAddress)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new NotImplementedException("Flux decoding is not yet implemented.");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
|
public override bool? VerifySectors(ulong sectorAddress, uint length, out List<ulong> failingLbas,
|
|
|
|
|
|
out List<ulong> unknownLbas)
|
2017-12-03 01:49:33 +00:00
|
|
|
|
{
|
|
|
|
|
|
throw new NotImplementedException("Flux decoding is not yet implemented.");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override bool? VerifyMediaImage()
|
|
|
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
|
if(Header.flags.HasFlag(ScpFlags.Writable)) return null;
|
2017-12-06 01:31:37 +00:00
|
|
|
|
|
|
|
|
|
|
byte[] wholeFile = new byte[scpStream.Length];
|
|
|
|
|
|
uint sum = 0;
|
|
|
|
|
|
|
|
|
|
|
|
scpStream.Position = 0;
|
|
|
|
|
|
scpStream.Read(wholeFile, 0, wholeFile.Length);
|
|
|
|
|
|
|
2017-12-19 20:33:03 +00:00
|
|
|
|
for(int i = 0x10; i < wholeFile.Length; i++) sum += wholeFile[i];
|
2017-12-06 01:31:37 +00:00
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
|
return Header.checksum == sum;
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSector(ulong sectorAddress, uint track)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
2017-12-19 20:33:03 +00:00
|
|
|
|
|
2017-12-03 01:49:33 +00:00
|
|
|
|
public override byte[] ReadSectors(ulong sectorAddress, uint length, uint track)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override List<Partition> GetPartitions()
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override List<Track> GetTracks()
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override List<Track> GetSessionTracks(Session session)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override List<Track> GetSessionTracks(ushort session)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override List<Session> GetSessions()
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override bool? VerifySector(ulong sectorAddress, uint track)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
|
public override bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List<ulong> failingLbas,
|
|
|
|
|
|
out List<ulong> unknownLbas)
|
2017-12-03 01:49:33 +00:00
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
2017-12-24 00:12:31 +00:00
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
|
public struct ScpHeader
|
|
|
|
|
|
{
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] signature;
|
|
|
|
|
|
public byte version;
|
|
|
|
|
|
public ScpDiskType type;
|
|
|
|
|
|
public byte revolutions;
|
|
|
|
|
|
public byte start;
|
|
|
|
|
|
public byte end;
|
|
|
|
|
|
public ScpFlags flags;
|
|
|
|
|
|
public byte bitCellEncoding;
|
|
|
|
|
|
public byte heads;
|
|
|
|
|
|
public byte reserved;
|
|
|
|
|
|
public uint checksum;
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 168)] public uint[] offsets;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public struct TrackHeader
|
|
|
|
|
|
{
|
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] Signature;
|
|
|
|
|
|
public byte TrackNumber;
|
|
|
|
|
|
public TrackEntry[] Entries;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
|
public struct TrackEntry
|
|
|
|
|
|
{
|
|
|
|
|
|
public uint indexTime;
|
|
|
|
|
|
public uint trackLength;
|
|
|
|
|
|
public uint dataOffset;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
|
struct ScpFooter
|
|
|
|
|
|
{
|
|
|
|
|
|
public uint manufacturerOffset;
|
|
|
|
|
|
public uint modelOffset;
|
|
|
|
|
|
public uint serialOffset;
|
|
|
|
|
|
public uint creatorOffset;
|
|
|
|
|
|
public uint applicationOffset;
|
|
|
|
|
|
public uint commentsOffset;
|
|
|
|
|
|
public long creationTime;
|
|
|
|
|
|
public long modificationTime;
|
|
|
|
|
|
public byte applicationVersion;
|
|
|
|
|
|
public byte hardwareVersion;
|
|
|
|
|
|
public byte firmwareVersion;
|
|
|
|
|
|
public byte imageVersion;
|
|
|
|
|
|
public uint signature;
|
|
|
|
|
|
}
|
2017-12-03 01:49:33 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|