public bool Identify(IMediaImage imagePlugin, Partition partition) { if (imagePlugin.Info.SectorSize < 256) { return(false); } byte[] sector = imagePlugin.ReadSector(partition.Start); LifSystemBlock lifSb = BigEndianMarshal.ByteArrayToStructureBigEndian <LifSystemBlock>(sector); DicConsole.DebugWriteLine("LIF plugin", "magic 0x{0:X8} (expected 0x{1:X8})", lifSb.magic, LIF_MAGIC); return(lifSb.magic == LIF_MAGIC); }
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding) { Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15"); information = ""; if (imagePlugin.Info.SectorSize < 256) { return; } byte[] sector = imagePlugin.ReadSector(partition.Start); LifSystemBlock lifSb = BigEndianMarshal.ByteArrayToStructureBigEndian <LifSystemBlock>(sector); if (lifSb.magic != LIF_MAGIC) { return; } StringBuilder sb = new StringBuilder(); sb.AppendLine("HP Logical Interchange Format"); sb.AppendFormat("Directory starts at cluster {0}", lifSb.directoryStart).AppendLine(); sb.AppendFormat("LIF identifier: {0}", lifSb.lifId).AppendLine(); sb.AppendFormat("Directory size: {0} clusters", lifSb.directorySize).AppendLine(); sb.AppendFormat("LIF version: {0}", lifSb.lifVersion).AppendLine(); // How is this related to volume size? I have only CDs to test and makes no sense there sb.AppendFormat("{0} tracks", lifSb.tracks).AppendLine(); sb.AppendFormat("{0} heads", lifSb.heads).AppendLine(); sb.AppendFormat("{0} sectors", lifSb.sectors).AppendLine(); sb.AppendFormat("Volume name: {0}", StringHandlers.CToString(lifSb.volumeLabel, Encoding)).AppendLine(); sb.AppendFormat("Volume created on {0}", DateHandlers.LifToDateTime(lifSb.creationDate)).AppendLine(); information = sb.ToString(); XmlFsType = new FileSystemType { Type = "HP Logical Interchange Format", ClusterSize = 256, Clusters = (long)(partition.Size / 256), CreationDate = DateHandlers.LifToDateTime(lifSb.creationDate), CreationDateSpecified = true, VolumeName = StringHandlers.CToString(lifSb.volumeLabel, Encoding) }; }