* Packages.mdproj:

* FileSystemIDandChk.sln:
	* FileSystemIDandChk/FileSystemIDandChk.csproj:
	  Added version and description to solution.

	* FileSystemIDandChk/Plugins/Plugin.cs:
	* FileSystemIDandChk/PartPlugins/PartPlugin.cs:
	* FileSystemIDandChk/ImagePlugins/ImagePlugin.cs:
	  Converted comments to inline XML documentation.

	* FileSystemIDandChk/ImagePlugins/TeleDisk.cs:
	  Removed unneeded "this" statements.
	Removed unreachable code.
	Removed spurious initialization.

	* FileSystemIDandChk/README.md:
	  Updated readme to show TeleDisk support and new version.
This commit is contained in:
2014-06-07 05:57:17 +01:00
parent 8e0dde88bc
commit 02d2e87749
8 changed files with 587 additions and 276 deletions

View File

@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010 # Visual Studio 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileSystemIDandChk", "FileSystemIDandChk\FileSystemIDandChk.csproj", "{7A4B05BE-73C9-4F34-87FE-E80CCF1F732D}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileSystemIDandChk", "FileSystemIDandChk\FileSystemIDandChk.csproj", "{7A4B05BE-73C9-4F34-87FE-E80CCF1F732D}"
EndProject EndProject
Project("{9344bdbb-3e7f-41fc-a0dd-8665d75ee146}") = "Packages", "Packages.mdproj", "{8996EF59-09B9-4920-A3DE-2F8EA2EBBCFF}" Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "Packages", "Packages.mdproj", "{8996EF59-09B9-4920-A3DE-2F8EA2EBBCFF}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -20,5 +20,7 @@ Global
EndGlobalSection EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = FileSystemIDandChk\FileSystemIDandChk.csproj StartupItem = FileSystemIDandChk\FileSystemIDandChk.csproj
description = Filesystem identified and checker.
version = 1.10
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View File

@@ -10,6 +10,7 @@
<RootNamespace>FileSystemIDandChk</RootNamespace> <RootNamespace>FileSystemIDandChk</RootNamespace>
<AssemblyName>FileSystemIDandChk</AssemblyName> <AssemblyName>FileSystemIDandChk</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<ReleaseVersion>1.10</ReleaseVersion>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<DebugSymbols>True</DebugSymbols> <DebugSymbols>True</DebugSymbols>

File diff suppressed because it is too large Load Diff

View File

@@ -456,7 +456,6 @@ namespace FileSystemIDandChk.ImagePlugins
{ {
if (spt != 0) if (spt != 0)
throw new FeatureUnsupportedImageException("Variable number of sectors per track. This kind of image is not yet supported"); throw new FeatureUnsupportedImageException("Variable number of sectors per track. This kind of image is not yet supported");
else
spt = TDTrack.sectors; spt = TDTrack.sectors;
} }
@@ -575,17 +574,17 @@ namespace FileSystemIDandChk.ImagePlugins
public override UInt64 GetImageSize() public override UInt64 GetImageSize()
{ {
return this.imageSizeWithoutHeaders; return imageSizeWithoutHeaders;
} }
public override UInt64 GetSectors() public override UInt64 GetSectors()
{ {
return (ulong)this.sectorsData.Count; return (ulong)sectorsData.Count;
} }
public override UInt32 GetSectorSize() public override UInt32 GetSectorSize()
{ {
return this.biggestSectorSize; return biggestSectorSize;
} }
public override byte[] ReadSector(UInt64 sectorAddress) public override byte[] ReadSector(UInt64 sectorAddress)
@@ -601,12 +600,12 @@ namespace FileSystemIDandChk.ImagePlugins
for (ulong i = sectorAddress; i < (sectorAddress + length); i++) for (ulong i = sectorAddress; i < (sectorAddress + length); i++)
{ {
if (!this.sectorsData.ContainsKey((uint)i)) if (!sectorsData.ContainsKey((uint)i))
throw new ImageNotSupportedException(String.Format("Requested sector {0} not found", i)); throw new ImageNotSupportedException(String.Format("Requested sector {0} not found", i));
byte[] sector; byte[] sector;
if(!this.sectorsData.TryGetValue((uint)i, out sector)) if(!sectorsData.TryGetValue((uint)i, out sector))
throw new ImageNotSupportedException(String.Format("Error reading sector {0}", i)); throw new ImageNotSupportedException(String.Format("Error reading sector {0}", i));
if (first) if (first)
@@ -643,7 +642,7 @@ namespace FileSystemIDandChk.ImagePlugins
public override string GetImageVersion() public override string GetImageVersion()
{ {
return this.telediskVersion; return telediskVersion;
} }
public override string GetImageApplication() public override string GetImageApplication()
@@ -653,38 +652,38 @@ namespace FileSystemIDandChk.ImagePlugins
public override string GetImageApplicationVersion() public override string GetImageApplicationVersion()
{ {
return this.telediskVersion; return telediskVersion;
} }
public override DateTime GetImageCreationTime() public override DateTime GetImageCreationTime()
{ {
return this.creationDate; return creationDate;
} }
public override DateTime GetImageLastModificationTime() public override DateTime GetImageLastModificationTime()
{ {
return this.modificationDate; return modificationDate;
} }
public override string GetImageName() public override string GetImageName()
{ {
return this.imageName; return imageName;
} }
public override DiskType GetDiskType() public override DiskType GetDiskType()
{ {
switch (this.header.driveType) switch (header.driveType)
{ {
case DriveType525DD: case DriveType525DD:
case DriveType525HD_DDDisk: case DriveType525HD_DDDisk:
case DriveType525HD: case DriveType525HD:
{ {
switch (this.totalDiskSize) switch (totalDiskSize)
{ {
case 163840: case 163840:
{ {
// Acorn disk uses 256 bytes/sector // Acorn disk uses 256 bytes/sector
if(this.biggestSectorSize == 256) if(biggestSectorSize == 256)
return DiskType.ACORN_525_SS_DD_40; return DiskType.ACORN_525_SS_DD_40;
else // DOS disks use 512 bytes/sector else // DOS disks use 512 bytes/sector
return DiskType.DOS_525_SS_DD_8; return DiskType.DOS_525_SS_DD_8;
@@ -692,7 +691,7 @@ namespace FileSystemIDandChk.ImagePlugins
case 184320: case 184320:
{ {
// Atari disk uses 256 bytes/sector // Atari disk uses 256 bytes/sector
if(this.biggestSectorSize == 256) if(biggestSectorSize == 256)
return DiskType.ATARI_525_DD; return DiskType.ATARI_525_DD;
else // DOS disks use 512 bytes/sector else // DOS disks use 512 bytes/sector
return DiskType.DOS_525_SS_DD_9; return DiskType.DOS_525_SS_DD_9;
@@ -700,7 +699,7 @@ namespace FileSystemIDandChk.ImagePlugins
case 327680: case 327680:
{ {
// Acorn disk uses 256 bytes/sector // Acorn disk uses 256 bytes/sector
if(this.biggestSectorSize == 256) if(biggestSectorSize == 256)
return DiskType.ACORN_525_SS_DD_80; return DiskType.ACORN_525_SS_DD_80;
else // DOS disks use 512 bytes/sector else // DOS disks use 512 bytes/sector
return DiskType.DOS_525_DS_DD_8; return DiskType.DOS_525_DS_DD_8;
@@ -742,17 +741,16 @@ namespace FileSystemIDandChk.ImagePlugins
default: default:
{ {
if (MainClass.isDebug) if (MainClass.isDebug)
Console.WriteLine("DEBUG (TeleDisk plugin): Unknown 5,25\" disk with {0} bytes", this.totalDiskSize); Console.WriteLine("DEBUG (TeleDisk plugin): Unknown 5,25\" disk with {0} bytes", totalDiskSize);
return DiskType.Unknown; return DiskType.Unknown;
} }
} }
break;
} }
case DriveType35DD: case DriveType35DD:
case DriveType35ED: case DriveType35ED:
case DriveType35HD: case DriveType35HD:
{ {
switch (this.totalDiskSize) switch (totalDiskSize)
{ {
case 327680: case 327680:
return DiskType.DOS_35_SS_DD_8; return DiskType.DOS_35_SS_DD_8;
@@ -788,14 +786,14 @@ namespace FileSystemIDandChk.ImagePlugins
default: default:
{ {
if (MainClass.isDebug) if (MainClass.isDebug)
Console.WriteLine("DEBUG (TeleDisk plugin): Unknown 3,5\" disk with {0} bytes", this.totalDiskSize); Console.WriteLine("DEBUG (TeleDisk plugin): Unknown 3,5\" disk with {0} bytes", totalDiskSize);
return DiskType.Unknown; return DiskType.Unknown;
} }
} }
} }
case DriveType8inch: case DriveType8inch:
{ {
switch (this.totalDiskSize) switch (totalDiskSize)
{ {
case 81664: case 81664:
return DiskType.IBM23FD; return DiskType.IBM23FD;
@@ -821,7 +819,7 @@ namespace FileSystemIDandChk.ImagePlugins
case 512512: case 512512:
{ {
// DEC disk uses 256 bytes/sector // DEC disk uses 256 bytes/sector
if(this.biggestSectorSize == 256) if(biggestSectorSize == 256)
return DiskType.RX02; return DiskType.RX02;
else // ECMA disks use 128 bytes/sector else // ECMA disks use 128 bytes/sector
return DiskType.ECMA_59; return DiskType.ECMA_59;
@@ -837,7 +835,7 @@ namespace FileSystemIDandChk.ImagePlugins
default: default:
{ {
if (MainClass.isDebug) if (MainClass.isDebug)
Console.WriteLine("DEBUG (TeleDisk plugin): Unknown 8\" disk with {0} bytes", this.totalDiskSize); Console.WriteLine("DEBUG (TeleDisk plugin): Unknown 8\" disk with {0} bytes", totalDiskSize);
return DiskType.Unknown; return DiskType.Unknown;
} }
} }
@@ -845,12 +843,11 @@ namespace FileSystemIDandChk.ImagePlugins
default: default:
{ {
if (MainClass.isDebug) if (MainClass.isDebug)
Console.WriteLine("DEBUG (TeleDisk plugin): Unknown drive type {1} with {0} bytes", this.totalDiskSize, this.header.driveType); Console.WriteLine("DEBUG (TeleDisk plugin): Unknown drive type {1} with {0} bytes", totalDiskSize, header.driveType);
return DiskType.Unknown; return DiskType.Unknown;
} }
} }
throw new NotImplementedException("Not yet implemented.");
} }
#region Private methods #region Private methods
@@ -952,7 +949,6 @@ namespace FileSystemIDandChk.ImagePlugins
if (Encoding == 0x00) if (Encoding == 0x00)
{ {
Length = encodedData[ins + 1]; Length = encodedData[ins + 1];
Piece = new byte[Length];
Array.Copy(encodedData, ins + 2, decodedData, outs, Length); Array.Copy(encodedData, ins + 2, decodedData, outs, Length);
ins += (2 + Length); ins += (2 + Length);
outs += Length; outs += Length;

View File

@@ -41,35 +41,49 @@ using System.Collections.Generic;
namespace FileSystemIDandChk.PartPlugins namespace FileSystemIDandChk.PartPlugins
{ {
/// <summary>
/// Abstract class to implement partitioning schemes interpreting plugins.
/// </summary>
public abstract class PartPlugin public abstract class PartPlugin
{ {
/// <summary>Plugin name.</summary>
public string Name; public string Name;
/// <summary>Plugin UUID.</summary>
public Guid PluginUUID; public Guid PluginUUID;
protected PartPlugin() protected PartPlugin()
{ {
} }
/// <summary>
/// Interprets a partitioning scheme.
/// </summary>
/// <returns><c>true</c>, if partitioning scheme is recognized, <c>false</c> otherwise.</returns>
/// <param name="imagePlugin">Disk image.</param>
/// <param name="partitions">Returns list of partitions.</param>
public abstract bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<Partition> partitions); public abstract bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<Partition> partitions);
} }
/// <summary>
/// Partition structure.
/// </summary>
public struct Partition public struct Partition
{ {
/// <summary>Partition number, 0-started</summary>
public ulong PartitionSequence; public ulong PartitionSequence;
// Partition number, 0-started /// <summary>Partition type</summary>
public string PartitionType; public string PartitionType;
// Partition type /// <summary>Partition name (if the scheme supports it)</summary>
public string PartitionName; public string PartitionName;
// Partition name (if the scheme supports it) /// <summary>Start of the partition, in bytes</summary>
public ulong PartitionStart; public ulong PartitionStart;
// Start of the partition, in bytes /// <summary>LBA of partition start</summary>
public ulong PartitionStartSector; public ulong PartitionStartSector;
// LBA of partition start /// <summary>Length in bytes of the partition</summary>
public ulong PartitionLength; public ulong PartitionLength;
// Length in bytes of the partition /// <summary>Length in sectors of the partition</summary>
public ulong PartitionSectors; public ulong PartitionSectors;
// Length in sectors of the partition /// <summary>Information that does not find space in this struct</summary>
public string PartitionDescription; public string PartitionDescription;
// Information that does not find space in this struct
} }
} }

View File

@@ -40,16 +40,34 @@ using System;
namespace FileSystemIDandChk.Plugins namespace FileSystemIDandChk.Plugins
{ {
/// <summary>
/// Abstract class to implement filesystem plugins.
/// </summary>
public abstract class Plugin public abstract class Plugin
{ {
/// <summary>Plugin name.</summary>
public string Name; public string Name;
/// <summary>Plugin UUID.</summary>
public Guid PluginUUID; public Guid PluginUUID;
protected Plugin() protected Plugin()
{ {
} }
/// <summary>
/// Identifies the filesystem in the specified LBA
/// </summary>
/// <param name="imagePlugin">Disk image.</param>
/// <param name="partitionOffset">Partition offset (LBA).</param>
/// <returns><c>true</c>, if the filesystem is recognized, <c>false</c> otherwise.</returns>
public abstract bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset); public abstract bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset);
/// <summary>
/// Gets information about the identified filesystem.
/// </summary>
/// <param name="imagePlugin">Disk image.</param>
/// <param name="partitionOffset">Partition offset (LBA).</param>
/// <param name="information">Filesystem information.</param>
public abstract void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information); public abstract void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information);
} }
} }

View File

@@ -1,4 +1,4 @@
FileSystemIDandChk v1.00 FileSystemIDandChk v1.10
============= =============
Filesystem identifier and checker. Filesystem identifier and checker.
@@ -17,9 +17,9 @@ Works under any operating system where there is Mono or .NET Framework. Tested w
Features Features
======== ========
* Supports reading CDRWin cue/bin cuesheets and Apple DiskCopy 4.2 * Supports reading CDRWin cue/bin cuesheets, Apple DiskCopy 4.2 and TeleDisk disk images.
* Supports traversing MBR, Apple and NeXT partitioning schemes * Supports traversing MBR, Apple and NeXT partitioning schemes.
* Identifies HFS, HFS+, MFS, BeFS, ext/2/3/4, FAT12/16/32, FFS/UFS/UFS2, HPFS, ISO9660, LisaFS, MinixFS, NTFS, ODS11, Opera, PCEngine, SolarFS, System V and UnixWare boot filesystem * Identifies HFS, HFS+, MFS, BeFS, ext/2/3/4, FAT12/16/32, FFS/UFS/UFS2, HPFS, ISO9660, LisaFS, MinixFS, NTFS, ODS11, Opera, PCEngine, SolarFS, System V and UnixWare boot filesystem.
Changelog Changelog
========= =========

View File

@@ -2,7 +2,7 @@
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<ItemType>PackagingProject</ItemType> <ItemType>PackagingProject</ItemType>
<ProductVersion>9.0.21022</ProductVersion> <ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion> <SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{8996EF59-09B9-4920-A3DE-2F8EA2EBBCFF}</ProjectGuid> <ProjectGuid>{8996EF59-09B9-4920-A3DE-2F8EA2EBBCFF}</ProjectGuid>
<Packages> <Packages>
@@ -41,5 +41,6 @@
</Package> </Package>
</Packages> </Packages>
</Packages> </Packages>
<ReleaseVersion>1.10</ReleaseVersion>
</PropertyGroup> </PropertyGroup>
</Project> </Project>