* DiscImageChef.Metadata/DiskType.cs:

* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
	  Added method to convert DiskType to disk type and subtype
	  strings.

	* DiscImageChef.DiscImages/CDRWin.cs:
	  Added extra track information.
	Corrected ReadLong for CD+G, subchannel should never come
	  along main channel on reading.

	* DiscImageChef.DiscImages/ImagePlugin.cs:
	  Added extra track information.
	Added audio media type.

	* DiscImageChef.DiscImages/Nero.cs:
	  Added extra track information.

	* DiscImageChef.DiscImages/ZZZRawImage.cs:
	  Added support for ReadLong and a single track and session
	  for optical discs.

	* DiscImageChef.Filesystems/FFS.cs:
	* DiscImageChef.Filesystems/BFS.cs:
	* DiscImageChef.Filesystems/ODS.cs:
	* DiscImageChef.Filesystems/SysV.cs:
	* DiscImageChef.Filesystems/extFS.cs:
	* DiscImageChef.Filesystems/ProDOS.cs:
	* DiscImageChef.Filesystems/ext2FS.cs:
	* DiscImageChef.Filesystems/LisaFS.cs:
	* DiscImageChef.Filesystems/MinixFS.cs:
	* DiscImageChef.Filesystems/UNIXBFS.cs:
	* DiscImageChef.Filesystems/AppleMFS.cs:
	* DiscImageChef.Filesystems/PCEngine.cs:
	* DiscImageChef.Filesystems/AppleHFS.cs:
	* DiscImageChef.Filesystems/AmigaDOS.cs:
	* DiscImageChef.Filesystems/AppleHFSPlus.cs:
	  Completed XML information.

	* DiscImageChef.Filesystems/ISO9660.cs:
	  Corrected fail in Sega CD IP.BIN decoding.
	Corrected IP.BIN date decoding.
	Trim spaces at end of Volume Descriptor string fields.
	Completed XML information.

	* DiscImageChef/Commands/Checksum.cs:
	  Checking memory usage on each step makes checksum
	  calculation abismally slower. Removed.

	* DiscImageChef/Main.cs:
	* DiscImageChef/Options.cs:
	* DiscImageChef/DiscImageChef.csproj:
	* DiscImageChef/Commands/CreateSidecar.cs:
	  Added method for creating CICM Metadata XML sidecar.
This commit is contained in:
2015-12-06 05:09:31 +00:00
parent 564775d3f7
commit 36e12eb1a7
31 changed files with 2354 additions and 125 deletions

View File

@@ -1799,8 +1799,8 @@ namespace DiscImageChef.ImagePlugins
case CDRWinTrackTypeCDG:
{
sector_offset = 0;
sector_size = 2448;
sector_skip = 0;
sector_size = 2352;
sector_skip = 96;
break;
}
default:
@@ -1907,6 +1907,19 @@ namespace DiscImageChef.ImagePlugins
_track.TrackSession = cdr_track.session;
_track.TrackSequence = cdr_track.sequence;
_track.TrackType = CDRWinTrackTypeToTrackType(cdr_track.tracktype);
_track.TrackFile = cdr_track.trackfile.datafile;
_track.TrackFileOffset = cdr_track.trackfile.offset;
_track.TrackFileType = cdr_track.trackfile.filetype;
_track.TrackRawBytesPerSector = cdr_track.bps;
_track.TrackBytesPerSector = CDRWinTrackTypeToCookedBytesPerSector(cdr_track.tracktype);
if (cdr_track.bps == 2448)
{
_track.TrackSubchannelFile = cdr_track.trackfile.datafile;
_track.TrackSubchannelOffset = cdr_track.trackfile.offset;
_track.TrackSubchannelType = TrackSubchannelType.RawInterleaved;
}
else
_track.TrackSubchannelType = TrackSubchannelType.None;
tracks.Add(_track);
previousStartSector = _track.TrackEndSector + 1;
@@ -1943,6 +1956,19 @@ namespace DiscImageChef.ImagePlugins
_track.TrackSession = cdr_track.session;
_track.TrackSequence = cdr_track.sequence;
_track.TrackType = CDRWinTrackTypeToTrackType(cdr_track.tracktype);
_track.TrackFile = cdr_track.trackfile.datafile;
_track.TrackFileOffset = cdr_track.trackfile.offset;
_track.TrackFileType = cdr_track.trackfile.filetype;
_track.TrackRawBytesPerSector = cdr_track.bps;
_track.TrackBytesPerSector = CDRWinTrackTypeToCookedBytesPerSector(cdr_track.tracktype);
if (cdr_track.bps == 2448)
{
_track.TrackSubchannelFile = cdr_track.trackfile.datafile;
_track.TrackSubchannelOffset = cdr_track.trackfile.offset;
_track.TrackSubchannelType = TrackSubchannelType.RawInterleaved;
}
else
_track.TrackSubchannelType = TrackSubchannelType.None;
tracks.Add(_track);
}
@@ -2078,6 +2104,30 @@ namespace DiscImageChef.ImagePlugins
}
}
static UInt16 CDRWinTrackTypeToCookedBytesPerSector(string trackType)
{
switch (trackType)
{
case CDRWinTrackTypeMode1:
case CDRWinTrackTypeMode2Form1:
case CDRWinTrackTypeMode1Raw:
return 2048;
case CDRWinTrackTypeMode2Form2:
return 2324;
case CDRWinTrackTypeMode2Formless:
case CDRWinTrackTypeCDI:
case CDRWinTrackTypeMode2Raw:
case CDRWinTrackTypeCDIRaw:
return 2336;
case CDRWinTrackTypeAudio:
return 2352;
case CDRWinTrackTypeCDG:
return 2448;
default:
return 0;
}
}
static TrackType CDRWinTrackTypeToTrackType(string trackType)
{
switch (trackType)

View File

@@ -1,3 +1,21 @@
2015-12-06 Natalia Portillo <claunia@claunia.com>
* CDRWin.cs:
Added extra track information.
Corrected ReadLong for CD+G, subchannel should never come
along main channel on reading.
* ImagePlugin.cs:
Added extra track information.
Added audio media type.
* Nero.cs:
Added extra track information.
* ZZZRawImage.cs:
Added support for ReadLong and a single track and session
for optical discs.
2015-12-05 Natalia Portillo <claunia@claunia.com>
* VHD.cs:

View File

@@ -467,6 +467,23 @@ namespace DiscImageChef.ImagePlugins
public string TrackDescription;
/// <summary>Indexes, 00 to 99 and sector offset</summary>
public Dictionary<int, UInt64> Indexes;
public string TrackFile;
public ulong TrackFileOffset;
public string TrackFileType;
public int TrackBytesPerSector;
public int TrackRawBytesPerSector;
public string TrackSubchannelFile;
public ulong TrackSubchannelOffset;
public TrackSubchannelType TrackSubchannelType;
}
public enum TrackSubchannelType
{
None,
Packed,
Raw,
PackedInterleaved,
RawInterleaved
}
/// <summary>
@@ -626,7 +643,8 @@ namespace DiscImageChef.ImagePlugins
{
OpticalDisc,
BlockMedia,
LinearMedia
LinearMedia,
AudioMedia
}
/// <summary>

View File

@@ -1533,6 +1533,55 @@ namespace DiscImageChef.ImagePlugins
_track.TrackStartSector = _neroTrack.StartLBA;
_track.TrackType = NeroTrackModeToTrackType((DAOMode)_neroTrack.Mode);
imageTracks.Add(_track);
_track.TrackFile = _imagePath;
_track.TrackFileOffset = _neroTrack.Offset;
_track.TrackFileType = "BINARY";
_track.TrackSubchannelType = TrackSubchannelType.None;
switch((DAOMode)_neroTrack.Mode)
{
case DAOMode.Audio:
_track.TrackBytesPerSector = 2352;
_track.TrackRawBytesPerSector = 2352;
break;
case DAOMode.AudioSub:
_track.TrackBytesPerSector = 2352;
_track.TrackRawBytesPerSector = 2448;
_track.TrackSubchannelType = TrackSubchannelType.RawInterleaved;
break;
case DAOMode.Data:
case DAOMode.DataM2F1:
_track.TrackBytesPerSector = 2048;
_track.TrackRawBytesPerSector = 2048;
break;
case DAOMode.DataM2F2:
_track.TrackBytesPerSector = 2336;
_track.TrackRawBytesPerSector = 2336;
break;
case DAOMode.DataM2Raw:
_track.TrackBytesPerSector = 2352;
_track.TrackRawBytesPerSector = 2352;
break;
case DAOMode.DataM2RawSub:
_track.TrackBytesPerSector = 2352;
_track.TrackRawBytesPerSector = 2448;
_track.TrackSubchannelType = TrackSubchannelType.RawInterleaved;
break;
case DAOMode.DataRaw:
_track.TrackBytesPerSector = 2048;
_track.TrackRawBytesPerSector = 2352;
break;
case DAOMode.DataRawSub:
_track.TrackBytesPerSector = 2048;
_track.TrackRawBytesPerSector = 2448;
_track.TrackSubchannelType = TrackSubchannelType.RawInterleaved;
break;
}
if(_track.TrackSubchannelType == TrackSubchannelType.RawInterleaved)
{
_track.TrackSubchannelFile = _imagePath;
_track.TrackSubchannelOffset = _neroTrack.Offset;
}
DicConsole.DebugWriteLine("Nero plugin", "\t\t _track.TrackDescription = {0}", _track.TrackDescription);
DicConsole.DebugWriteLine("Nero plugin", "\t\t _track.TrackEndSector = {0}", _track.TrackEndSector);

View File

@@ -398,6 +398,154 @@ namespace DiscImageChef.ImagePlugins
return null;
}
public override List<Track> GetTracks()
{
if (ImageInfo.xmlMediaType == XmlMediaType.OpticalDisc)
{
Track trk = new Track();
trk.TrackBytesPerSector = (int)ImageInfo.sectorSize;
trk.TrackEndSector = ImageInfo.sectors - 1;
trk.TrackFile = rawImagePath;
trk.TrackFileOffset = 0;
trk.TrackFileType = "BINARY";
trk.TrackRawBytesPerSector = (int)ImageInfo.sectorSize;
trk.TrackSequence = 1;
trk.TrackStartSector = 0;
trk.TrackSubchannelType = TrackSubchannelType.None;
trk.TrackType = TrackType.Data;
trk.TrackSession = 1;
List<Track> lst = new List<Track>();
lst.Add(trk);
return lst;
}
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public override List<Track> GetSessionTracks(Session session)
{
if (ImageInfo.xmlMediaType == XmlMediaType.OpticalDisc)
{
if (session.SessionSequence != 1)
throw new ArgumentOutOfRangeException("session", "Only a single session is supported");
Track trk = new Track();
trk.TrackBytesPerSector = (int)ImageInfo.sectorSize;
trk.TrackEndSector = ImageInfo.sectors - 1;
trk.TrackFile = rawImagePath;
trk.TrackFileOffset = 0;
trk.TrackFileType = "BINARY";
trk.TrackRawBytesPerSector = (int)ImageInfo.sectorSize;
trk.TrackSequence = 1;
trk.TrackStartSector = 0;
trk.TrackSubchannelType = TrackSubchannelType.None;
trk.TrackType = TrackType.Data;
trk.TrackSession = 1;
List<Track> lst = new List<Track>();
lst.Add(trk);
return lst;
}
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public override List<Track> GetSessionTracks(UInt16 session)
{
if (ImageInfo.xmlMediaType == XmlMediaType.OpticalDisc)
{
if (session != 1)
throw new ArgumentOutOfRangeException("session", "Only a single session is supported");
Track trk = new Track();
trk.TrackBytesPerSector = (int)ImageInfo.sectorSize;
trk.TrackEndSector = ImageInfo.sectors - 1;
trk.TrackFile = rawImagePath;
trk.TrackFileOffset = 0;
trk.TrackFileType = "BINARY";
trk.TrackRawBytesPerSector = (int)ImageInfo.sectorSize;
trk.TrackSequence = 1;
trk.TrackStartSector = 0;
trk.TrackSubchannelType = TrackSubchannelType.None;
trk.TrackType = TrackType.Data;
trk.TrackSession = 1;
List<Track> lst = new List<Track>();
lst.Add(trk);
return lst;
}
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public override List<Session> GetSessions()
{
if (ImageInfo.xmlMediaType == XmlMediaType.OpticalDisc)
{
Session sess = new Session();
sess.EndSector = ImageInfo.sectors - 1;
sess.EndTrack = 1;
sess.SessionSequence = 1;
sess.StartSector = 0;
sess.StartTrack = 1;
List<Session> lst = new List<Session>();
lst.Add(sess);
return lst;
}
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public override byte[] ReadSector(UInt64 sectorAddress, UInt32 track)
{
if (ImageInfo.xmlMediaType == XmlMediaType.OpticalDisc)
{
if (track != 1)
throw new ArgumentOutOfRangeException("track", "Only a single session is supported");
return ReadSector(sectorAddress);
}
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public override byte[] ReadSectors(UInt64 sectorAddress, UInt32 length, UInt32 track)
{
if (ImageInfo.xmlMediaType == XmlMediaType.OpticalDisc)
{
if (track != 1)
throw new ArgumentOutOfRangeException("track", "Only a single session is supported");
return ReadSectors(sectorAddress, length);
}
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public override byte[] ReadSectorLong(UInt64 sectorAddress, UInt32 track)
{
if (ImageInfo.xmlMediaType == XmlMediaType.OpticalDisc)
{
if (track != 1)
throw new ArgumentOutOfRangeException("track", "Only a single session is supported");
return ReadSector(sectorAddress);
}
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public override byte[] ReadSectorsLong(UInt64 sectorAddress, UInt32 length, UInt32 track)
{
if (ImageInfo.xmlMediaType == XmlMediaType.OpticalDisc)
{
if (track != 1)
throw new ArgumentOutOfRangeException("track", "Only a single session is supported");
return ReadSectors(sectorAddress, length);
}
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
#region Private methods
DiskType CalculateDiskType()
@@ -645,56 +793,16 @@ namespace DiscImageChef.ImagePlugins
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(UInt16 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 byte[] ReadSector(UInt64 sectorAddress, UInt32 track)
{
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public override byte[] ReadSectorTag(UInt64 sectorAddress, UInt32 track, SectorTagType tag)
{
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public override byte[] ReadSectors(UInt64 sectorAddress, UInt32 length, UInt32 track)
{
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public override byte[] ReadSectorsTag(UInt64 sectorAddress, UInt32 length, UInt32 track, SectorTagType tag)
{
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public override byte[] ReadSectorLong(UInt64 sectorAddress, UInt32 track)
{
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
public override byte[] ReadSectorsLong(UInt64 sectorAddress, UInt32 length, UInt32 track)
{
throw new FeatureUnsupportedImageException("Feature not supported by image format");
}
#endregion Unsupported features
}
}

View File

@@ -355,8 +355,12 @@ namespace DiscImageChef.Plugins
information = sbInformation.ToString();
xmlFSType.CreationDate = DateHandlers.AmigaToDateTime(rootBlk.cDays, rootBlk.cMins, rootBlk.cTicks);
xmlFSType.CreationDateSpecified = true;
xmlFSType.ModificationDate = DateHandlers.AmigaToDateTime(rootBlk.vDays, rootBlk.vMins, rootBlk.vTicks);
xmlFSType.ModificationDateSpecified = true;
xmlFSType.Dirty = rootBlk.bitmapFlag != 0xFFFFFFFF;
xmlFSType.Clusters = (long)((partitionEnd - partitionStart) + 1);
xmlFSType.ClusterSize = (int)imagePlugin.GetSectorSize();
}
static UInt32 AmigaChecksum(byte[] data)

View File

@@ -361,15 +361,29 @@ namespace DiscImageChef.Plugins
information = sb.ToString();
xmlFSType = new Schemas.FileSystemType();
xmlFSType.BackupDate = DateHandlers.MacToDateTime(MDB.drVolBkUp);
if (MDB.drVolBkUp > 0)
{
xmlFSType.BackupDate = DateHandlers.MacToDateTime(MDB.drVolBkUp);
xmlFSType.BackupDateSpecified = true;
}
xmlFSType.Bootable = BB.signature == HFSBB_MAGIC;
xmlFSType.Clusters = MDB.drNmAlBlks;
xmlFSType.ClusterSize = (int)MDB.drAlBlkSiz;
xmlFSType.CreationDate = DateHandlers.MacToDateTime(MDB.drCrDate);
if (MDB.drCrDate > 0)
{
xmlFSType.CreationDate = DateHandlers.MacToDateTime(MDB.drCrDate);
xmlFSType.CreationDateSpecified = true;
}
xmlFSType.Dirty = (MDB.drAtrb & 0x100) != 0x100;
xmlFSType.Files = MDB.drFilCnt;
xmlFSType.FilesSpecified = true;
xmlFSType.FreeClusters = MDB.drFreeBks;
xmlFSType.ModificationDate = DateHandlers.MacToDateTime(MDB.drLsMod);
xmlFSType.FreeClustersSpecified = true;
if (MDB.drLsMod > 0)
{
xmlFSType.ModificationDate = DateHandlers.MacToDateTime(MDB.drLsMod);
xmlFSType.ModificationDateSpecified = true;
}
xmlFSType.Type = "HFS";
xmlFSType.VolumeName = MDB.drVN;
if (MDB.drFndrInfo6 != 0 && MDB.drFndrInfo7 != 0)

View File

@@ -258,16 +258,30 @@ namespace DiscImageChef.Plugins
sb.AppendFormat("Mac OS X Volume ID: {0:X8}{1:X8}", HPVH.drFndrInfo6, HPVH.drFndrInfo7).AppendLine();
xmlFSType = new Schemas.FileSystemType();
xmlFSType.BackupDate = DateHandlers.MacToDateTime(HPVH.backupDate);
if (HPVH.backupDate > 0)
{
xmlFSType.BackupDate = DateHandlers.MacToDateTime(HPVH.backupDate);
xmlFSType.BackupDateSpecified = true;
}
if(HPVH.drFndrInfo0 != 0 || HPVH.drFndrInfo3 != 0 || HPVH.drFndrInfo5 != 0)
xmlFSType.Bootable = true;
xmlFSType.Clusters = HPVH.totalBlocks;
xmlFSType.ClusterSize = (int)HPVH.blockSize;
xmlFSType.CreationDate = DateHandlers.MacToDateTime(HPVH.createDate);
if (HPVH.createDate > 0)
{
xmlFSType.CreationDate = DateHandlers.MacToDateTime(HPVH.createDate);
xmlFSType.CreationDateSpecified = true;
}
xmlFSType.Dirty = (HPVH.attributes & 0x100) != 0x100;
xmlFSType.Files = HPVH.fileCount;
xmlFSType.FilesSpecified = true;
xmlFSType.FreeClusters = HPVH.freeBlocks;
xmlFSType.ModificationDate = DateHandlers.MacToDateTime(HPVH.modifyDate);
xmlFSType.FreeClustersSpecified = true;
if (HPVH.modifyDate > 0)
{
xmlFSType.ModificationDate = DateHandlers.MacToDateTime(HPVH.modifyDate);
xmlFSType.ModificationDateSpecified = true;
}
if(HPVH.signature == 0x482B)
xmlFSType.Type = "HFS+";
if(HPVH.signature == 0x4858)

View File

@@ -197,13 +197,23 @@ namespace DiscImageChef.Plugins
information = sb.ToString();
xmlFSType = new Schemas.FileSystemType();
xmlFSType.BackupDate = DateHandlers.MacToDateTime(MDB.drLsBkUp);
if (MDB.drLsBkUp > 0)
{
xmlFSType.BackupDate = DateHandlers.MacToDateTime(MDB.drLsBkUp);
xmlFSType.BackupDateSpecified = true;
}
xmlFSType.Bootable = BB.signature == MFSBB_MAGIC;
xmlFSType.Clusters = MDB.drNmAlBlks;
xmlFSType.ClusterSize = (int)MDB.drAlBlkSiz;
xmlFSType.CreationDate = DateHandlers.MacToDateTime(MDB.drCrDate);
if (MDB.drCrDate > 0)
{
xmlFSType.CreationDate = DateHandlers.MacToDateTime(MDB.drCrDate);
xmlFSType.CreationDateSpecified = true;
}
xmlFSType.Files = MDB.drNmFls;
xmlFSType.FilesSpecified = true;
xmlFSType.FreeClusters = MDB.drFreeBks;
xmlFSType.FreeClustersSpecified = true;
xmlFSType.Type = "MFS";
xmlFSType.VolumeName = MDB.drVN;

View File

@@ -225,6 +225,7 @@ namespace DiscImageChef.Plugins
xmlFSType.ClusterSize = (int)besb.block_size;
xmlFSType.Dirty = besb.flags == BEFS_DIRTY;
xmlFSType.FreeClusters = besb.num_blocks - besb.used_blocks;
xmlFSType.FreeClustersSpecified = true;
xmlFSType.Type = "BeFS";
xmlFSType.VolumeName = besb.name;
}

View File

@@ -1,3 +1,28 @@
2015-12-06 Natalia Portillo <claunia@claunia.com>
* FFS.cs:
* BFS.cs:
* ODS.cs:
* SysV.cs:
* extFS.cs:
* ProDOS.cs:
* ext2FS.cs:
* LisaFS.cs:
* MinixFS.cs:
* UNIXBFS.cs:
* AppleMFS.cs:
* PCEngine.cs:
* AppleHFS.cs:
* AmigaDOS.cs:
* AppleHFSPlus.cs:
Completed XML information.
* ISO9660.cs:
Corrected fail in Sega CD IP.BIN decoding.
Corrected IP.BIN date decoding.
Trim spaces at end of Volume Descriptor string fields.
Completed XML information.
2015-12-05 Natalia Portillo <claunia@claunia.com>
* FAT.cs:

View File

@@ -651,6 +651,7 @@ namespace DiscImageChef.Plugins
sbInformation.AppendFormat("{0} directories", ufs_sb.fs_cstotal_ndir).AppendLine();
sbInformation.AppendFormat("{0} free blocks ({1} bytes)", ufs_sb.fs_cstotal_nbfree, ufs_sb.fs_cstotal_nbfree * ufs_sb.fs_bsize).AppendLine();
xmlFSType.FreeClusters = ufs_sb.fs_cstotal_nbfree;
xmlFSType.FreeClustersSpecified = true;
sbInformation.AppendFormat("{0} free inodes", ufs_sb.fs_cstotal_nifree).AppendLine();
sbInformation.AppendFormat("{0} free frags", ufs_sb.fs_cstotal_nffree).AppendLine();
if (ufs_sb.fs_fmod == 1)
@@ -681,11 +682,13 @@ namespace DiscImageChef.Plugins
sbInformation.AppendFormat("{0} directories", ufs_sb.fs_cstotal_ndir_ufs2).AppendLine();
sbInformation.AppendFormat("{0} free blocks ({1} bytes)", ufs_sb.fs_cstotal_nbfree_ufs2, ufs_sb.fs_cstotal_nbfree_ufs2 * ufs_sb.fs_bsize).AppendLine();
xmlFSType.FreeClusters = (long)ufs_sb.fs_cstotal_nbfree_ufs2;
xmlFSType.FreeClustersSpecified = true;
sbInformation.AppendFormat("{0} free inodes", ufs_sb.fs_cstotal_nifree_ufs2).AppendLine();
sbInformation.AppendFormat("{0} free frags", ufs_sb.fs_cstotal_nffree_ufs2).AppendLine();
sbInformation.AppendFormat("{0} free clusters", ufs_sb.fs_cstotal_numclusters_ufs2).AppendLine();
sbInformation.AppendFormat("Volume last written on {0}", DateHandlers.UNIXUnsignedToDateTime(ufs_sb.fs_time_sec_ufs2)).AppendLine();
xmlFSType.ModificationDate = DateHandlers.UNIXUnsignedToDateTime(ufs_sb.fs_time_sec_ufs2);
xmlFSType.ModificationDateSpecified = true;
sbInformation.AppendFormat("{0} blocks ({1} bytes)", ufs_sb.fs_size_ufs2, ufs_sb.fs_size_ufs2 * ufs_sb.fs_bsize).AppendLine();
xmlFSType.Clusters = (long)ufs_sb.fs_dsize_ufs2;
sbInformation.AppendFormat("{0} data blocks ({1} bytes)", ufs_sb.fs_dsize_ufs2, ufs_sb.fs_dsize_ufs2 * ufs_sb.fs_bsize).AppendLine();

View File

@@ -393,8 +393,8 @@ namespace DiscImageChef.Plugins
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.volume_name = \"{0}\"", Encoding.ASCII.GetString(volume_name));
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.system_name = \"{0}\"", Encoding.ASCII.GetString(system_name));
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.volume_version = \"{0}\"", Encoding.ASCII.GetString(volume_version));
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.volume_type = 0x{0}", BitConverter.ToInt32(volume_type, 0).ToString("X"));
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.system_version = 0x{0}", BitConverter.ToInt32(system_version, 0).ToString("X"));
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.volume_type = 0x{0}", BitConverter.ToInt16(volume_type, 0).ToString("X"));
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.system_version = 0x{0}", BitConverter.ToInt16(system_version, 0).ToString("X"));
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.ip_address = 0x{0}", BitConverter.ToInt32(ip_address, 0).ToString("X"));
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.ip_loadsize = {0}", BitConverter.ToInt32(ip_loadsize, 0));
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.ip_entry_address = 0x{0}", BitConverter.ToInt32(ip_entry_address, 0).ToString("X"));
@@ -413,9 +413,20 @@ namespace DiscImageChef.Plugins
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.region_codes = \"{0}\"", Encoding.ASCII.GetString(region_codes));
// Decoding all data
DateTime ipbindate;
DateTime ipbindate = DateTime.MinValue;
CultureInfo provider = CultureInfo.InvariantCulture;
ipbindate = DateTime.ParseExact(Encoding.ASCII.GetString(release_date), "MMddyyyy", provider);
try
{
ipbindate = DateTime.ParseExact(Encoding.ASCII.GetString(release_date), "MMddyyyy", provider);
}
catch
{
try
{
ipbindate = DateTime.ParseExact(Encoding.ASCII.GetString(release_date2), "yyyy.MMM", provider);
}
catch {}
}
/*
switch (Encoding.ASCII.GetString(application_type))
@@ -445,8 +456,9 @@ namespace DiscImageChef.Plugins
IPBinInformation.AppendFormat("System program load size: {0} bytes", BitConverter.ToInt32(sp_loadsize, 0)).AppendLine();
IPBinInformation.AppendFormat("System program entry address: 0x{0}", BitConverter.ToInt32(sp_entry_address, 0).ToString("X")).AppendLine();
IPBinInformation.AppendFormat("System program work RAM: {0} bytes", BitConverter.ToInt32(sp_work_ram_size, 0)).AppendLine();
IPBinInformation.AppendFormat("Release date: {0}", ipbindate).AppendLine();
IPBinInformation.AppendFormat("Release date (other format): {0}", Encoding.ASCII.GetString(release_date2)).AppendLine();
if(ipbindate != DateTime.MinValue)
IPBinInformation.AppendFormat("Release date: {0}", ipbindate).AppendLine();
//IPBinInformation.AppendFormat("Release date (other format): {0}", Encoding.ASCII.GetString(release_date2)).AppendLine();
IPBinInformation.AppendFormat("Hardware ID: {0}", Encoding.ASCII.GetString(hardware_id)).AppendLine();
IPBinInformation.AppendFormat("Developer code: {0}", Encoding.ASCII.GetString(developer_code)).AppendLine();
IPBinInformation.AppendFormat("Domestic title: {0}", Encoding.ASCII.GetString(domestic_title)).AppendLine();
@@ -879,7 +891,59 @@ namespace DiscImageChef.Plugins
if (Joliet)
{
xmlFSType.SystemIdentifier = decodedJolietVD.SystemIdentifier;
xmlFSType.VolumeName = decodedJolietVD.VolumeIdentifier;
xmlFSType.VolumeSetIdentifier = decodedJolietVD.VolumeSetIdentifier;
xmlFSType.PublisherIdentifier = decodedJolietVD.PublisherIdentifier;
xmlFSType.DataPreparerIdentifier = decodedJolietVD.DataPreparerIdentifier;
xmlFSType.ApplicationIdentifier = decodedJolietVD.ApplicationIdentifier;
xmlFSType.CreationDate = decodedJolietVD.CreationTime;
xmlFSType.CreationDateSpecified = true;
if (decodedJolietVD.HasModificationTime)
{
xmlFSType.ModificationDate = decodedJolietVD.ModificationTime;
xmlFSType.ModificationDateSpecified = true;
}
if (decodedJolietVD.HasExpirationTime)
{
xmlFSType.ExpirationDate = decodedJolietVD.ExpirationTime;
xmlFSType.ExpirationDateSpecified = true;
}
if (decodedJolietVD.HasEffectiveTime)
{
xmlFSType.EffectiveDate = decodedJolietVD.EffectiveTime;
xmlFSType.EffectiveDateSpecified = true;
}
}
else
{
xmlFSType.SystemIdentifier = decodedVD.SystemIdentifier;
xmlFSType.VolumeName = decodedVD.VolumeIdentifier;
xmlFSType.VolumeSetIdentifier = decodedVD.VolumeSetIdentifier;
xmlFSType.PublisherIdentifier = decodedVD.PublisherIdentifier;
xmlFSType.DataPreparerIdentifier = decodedVD.DataPreparerIdentifier;
xmlFSType.ApplicationIdentifier = decodedVD.ApplicationIdentifier;
xmlFSType.CreationDate = decodedVD.CreationTime;
xmlFSType.CreationDateSpecified = true;
if (decodedVD.HasModificationTime)
{
xmlFSType.ModificationDate = decodedVD.ModificationTime;
xmlFSType.ModificationDateSpecified = true;
}
if (decodedVD.HasExpirationTime)
{
xmlFSType.ExpirationDate = decodedVD.ExpirationTime;
xmlFSType.ExpirationDateSpecified = true;
}
if (decodedVD.HasEffectiveTime)
{
xmlFSType.EffectiveDate = decodedVD.EffectiveTime;
xmlFSType.EffectiveDateSpecified = true;
}
}
xmlFSType.Bootable |= Bootable || SegaCD || Saturn || Dreamcast;
xmlFSType.Clusters = (long)(partitionEnd - partitionStart + 1);
xmlFSType.ClusterSize = 2048;
information = ISOMetadata.ToString();
}
@@ -888,12 +952,12 @@ namespace DiscImageChef.Plugins
{
DecodedVolumeDescriptor decodedVD = new DecodedVolumeDescriptor();
decodedVD.SystemIdentifier = Encoding.BigEndianUnicode.GetString(VDSysId);
decodedVD.VolumeIdentifier = Encoding.BigEndianUnicode.GetString(VDVolId);
decodedVD.VolumeSetIdentifier = Encoding.BigEndianUnicode.GetString(VDVolSetId);
decodedVD.PublisherIdentifier = Encoding.BigEndianUnicode.GetString(VDPubId);
decodedVD.DataPreparerIdentifier = Encoding.BigEndianUnicode.GetString(VDDataPrepId);
decodedVD.ApplicationIdentifier = Encoding.BigEndianUnicode.GetString(VDAppId);
decodedVD.SystemIdentifier = Encoding.BigEndianUnicode.GetString(VDSysId).TrimEnd();
decodedVD.VolumeIdentifier = Encoding.BigEndianUnicode.GetString(VDVolId).TrimEnd();
decodedVD.VolumeSetIdentifier = Encoding.BigEndianUnicode.GetString(VDVolSetId).TrimEnd();
decodedVD.PublisherIdentifier = Encoding.BigEndianUnicode.GetString(VDPubId).TrimEnd();
decodedVD.DataPreparerIdentifier = Encoding.BigEndianUnicode.GetString(VDDataPrepId).TrimEnd();
decodedVD.ApplicationIdentifier = Encoding.BigEndianUnicode.GetString(VDAppId).TrimEnd();
if (VCTime[0] == '0' || VCTime[0] == 0x00)
decodedVD.CreationTime = DateTime.MinValue;
else
@@ -936,12 +1000,12 @@ namespace DiscImageChef.Plugins
{
DecodedVolumeDescriptor decodedVD = new DecodedVolumeDescriptor();
decodedVD.SystemIdentifier = Encoding.ASCII.GetString(VDSysId);
decodedVD.VolumeIdentifier = Encoding.ASCII.GetString(VDVolId);
decodedVD.VolumeSetIdentifier = Encoding.ASCII.GetString(VDVolSetId);
decodedVD.PublisherIdentifier = Encoding.ASCII.GetString(VDPubId);
decodedVD.DataPreparerIdentifier = Encoding.ASCII.GetString(VDDataPrepId);
decodedVD.ApplicationIdentifier = Encoding.ASCII.GetString(VDAppId);
decodedVD.SystemIdentifier = Encoding.ASCII.GetString(VDSysId).TrimEnd();
decodedVD.VolumeIdentifier = Encoding.ASCII.GetString(VDVolId).TrimEnd();
decodedVD.VolumeSetIdentifier = Encoding.ASCII.GetString(VDVolSetId).TrimEnd();
decodedVD.PublisherIdentifier = Encoding.ASCII.GetString(VDPubId).TrimEnd();
decodedVD.DataPreparerIdentifier = Encoding.ASCII.GetString(VDDataPrepId).TrimEnd();
decodedVD.ApplicationIdentifier = Encoding.ASCII.GetString(VDAppId).TrimEnd();
if (VCTime[0] == '0' || VCTime[0] == 0x00)
decodedVD.CreationTime = DateTime.MinValue;
else

View File

@@ -387,13 +387,23 @@ namespace DiscImageChef.Plugins
information = sb.ToString();
xmlFSType = new Schemas.FileSystemType();
xmlFSType.BackupDate = mddf.dtvb;
if(DateTime.Compare(mddf.dtvb, DateHandlers.LisaToDateTime(0)) > 0)
{
xmlFSType.BackupDate = mddf.dtvb;
xmlFSType.BackupDateSpecified = true;
}
xmlFSType.Clusters = mddf.vol_size;
xmlFSType.ClusterSize = mddf.clustersize * mddf.datasize;
xmlFSType.CreationDate = mddf.dtvc;
if(DateTime.Compare(mddf.dtvc, DateHandlers.LisaToDateTime(0)) > 0)
{
xmlFSType.CreationDate = mddf.dtvc;
xmlFSType.CreationDateSpecified = true;
}
xmlFSType.Dirty = mddf.vol_left_mounted != 0;
xmlFSType.Files = mddf.filecount;
xmlFSType.FilesSpecified = true;
xmlFSType.FreeClusters = mddf.freecount;
xmlFSType.FreeClustersSpecified = true;
xmlFSType.Type = "LisaFS";
xmlFSType.VolumeName = mddf.volname;
xmlFSType.VolumeSerial = String.Format("{0:X16}", mddf.volid);

View File

@@ -209,6 +209,7 @@ namespace DiscImageChef.Plugins
sb.AppendFormat("On-disk filesystem version: {0}", mnx_sb.s_disk_version).AppendLine();
xmlFSType.ClusterSize = mnx_sb.s_blocksize;
xmlFSType.Clusters = (long)((partitionEnd - partitionStart + 1) * imagePlugin.GetSectorSize() / mnx_sb.s_blocksize);
}
else
{
@@ -239,6 +240,7 @@ namespace DiscImageChef.Plugins
sb.AppendFormat("{0} bytes maximum per file", mnx_sb.s_max_size).AppendLine();
sb.AppendFormat("Filesystem state: {0:X4}", mnx_sb.s_state).AppendLine();
xmlFSType.ClusterSize = 1024;
xmlFSType.Clusters = (long)((partitionEnd - partitionStart + 1) * imagePlugin.GetSectorSize() / 1024);
}
information = sb.ToString();
}

View File

@@ -260,11 +260,19 @@ namespace DiscImageChef.Plugins
xmlFSType = new Schemas.FileSystemType();
xmlFSType.Type = "FILES-11";
xmlFSType.ClusterSize = homeblock.cluster * 512;
xmlFSType.Clusters = homeblock.cluster;
xmlFSType.VolumeName = homeblock.volname;
xmlFSType.VolumeSerial = String.Format("{0:X8}", homeblock.serialnum);
xmlFSType.CreationDate = DateHandlers.VMSToDateTime(homeblock.credate);
if (homeblock.credate > 0)
{
xmlFSType.CreationDate = DateHandlers.VMSToDateTime(homeblock.credate);
xmlFSType.CreationDateSpecified = true;
}
if (homeblock.revdate > 0)
{
xmlFSType.ModificationDate = DateHandlers.VMSToDateTime(homeblock.revdate);
xmlFSType.ModificationDateSpecified = true;
}
information = sb.ToString();
}

View File

@@ -68,6 +68,8 @@ namespace DiscImageChef.Plugins
information = "";
xmlFSType = new Schemas.FileSystemType();
xmlFSType.Type = "PC Engine filesystem";
xmlFSType.Clusters = (long)((partitionEnd - partitionStart + 1) / imagePlugin.GetSectorSize() * 2048);
xmlFSType.ClusterSize = 2048;
}
}
}

View File

@@ -219,9 +219,15 @@ namespace DiscImageChef.Plugins
xmlFSType = new Schemas.FileSystemType();
xmlFSType.VolumeName = rootDirectoryKeyBlock.header.volume_name;
xmlFSType.CreationDate = rootDirectoryKeyBlock.header.creation_time;
if (year != 0 || month != 0 || day != 0 || hour != 0 || minute != 0)
{
xmlFSType.CreationDate = rootDirectoryKeyBlock.header.creation_time;
xmlFSType.CreationDateSpecified = true;
}
xmlFSType.Files = rootDirectoryKeyBlock.header.file_count;
xmlFSType.FilesSpecified = true;
xmlFSType.Clusters = rootDirectoryKeyBlock.header.total_blocks;
xmlFSType.ClusterSize = (int)((partitionEnd - partitionStart + 1) / (ulong)xmlFSType.Clusters);
xmlFSType.Type = "ProDOS";
return;

View File

@@ -343,7 +343,11 @@ namespace DiscImageChef.Plugins
if (xnx_sb.s_ronly > 0)
sb.AppendLine("Volume is mounted read-only");
sb.AppendFormat("Superblock last updated on {0}", DateHandlers.UNIXUnsignedToDateTime(xnx_sb.s_time)).AppendLine();
xmlFSType.ModificationDate = DateHandlers.UNIXUnsignedToDateTime(xnx_sb.s_time);
if (xnx_sb.s_time != 0)
{
xmlFSType.ModificationDate = DateHandlers.UNIXUnsignedToDateTime(xnx_sb.s_time);
xmlFSType.ModificationDateSpecified = true;
}
sb.AppendFormat("Volume name: {0}", xnx_sb.s_fname).AppendLine();
xmlFSType.VolumeName = xnx_sb.s_fname;
sb.AppendFormat("Pack name: {0}", xnx_sb.s_fpack).AppendLine();
@@ -478,7 +482,11 @@ namespace DiscImageChef.Plugins
if (sysv_sb.s_ronly > 0)
sb.AppendLine("Volume is mounted read-only");
sb.AppendFormat("Superblock last updated on {0}", DateHandlers.UNIXUnsignedToDateTime(sysv_sb.s_time)).AppendLine();
xmlFSType.ModificationDate = DateHandlers.UNIXUnsignedToDateTime(sysv_sb.s_time);
if (sysv_sb.s_time != 0)
{
xmlFSType.ModificationDate = DateHandlers.UNIXUnsignedToDateTime(sysv_sb.s_time);
xmlFSType.ModificationDateSpecified = true;
}
sb.AppendFormat("Volume name: {0}", sysv_sb.s_fname).AppendLine();
xmlFSType.VolumeName = sysv_sb.s_fname;
sb.AppendFormat("Pack name: {0}", sysv_sb.s_fpack).AppendLine();
@@ -536,7 +544,11 @@ namespace DiscImageChef.Plugins
if (coh_sb.s_ronly > 0)
sb.AppendLine("Volume is mounted read-only");
sb.AppendFormat("Superblock last updated on {0}", DateHandlers.UNIXUnsignedToDateTime(coh_sb.s_time)).AppendLine();
xmlFSType.ModificationDate = DateHandlers.UNIXUnsignedToDateTime(coh_sb.s_time);
if (coh_sb.s_time != 0)
{
xmlFSType.ModificationDate = DateHandlers.UNIXUnsignedToDateTime(coh_sb.s_time);
xmlFSType.ModificationDateSpecified = true;
}
sb.AppendFormat("Volume name: {0}", coh_sb.s_fname).AppendLine();
xmlFSType.VolumeName = coh_sb.s_fname;
sb.AppendFormat("Pack name: {0}", coh_sb.s_fpack).AppendLine();
@@ -586,7 +598,11 @@ namespace DiscImageChef.Plugins
if (v7_sb.s_ronly > 0)
sb.AppendLine("Volume is mounted read-only");
sb.AppendFormat("Superblock last updated on {0}", DateHandlers.UNIXUnsignedToDateTime(v7_sb.s_time)).AppendLine();
xmlFSType.ModificationDate = DateHandlers.UNIXUnsignedToDateTime(v7_sb.s_time);
if (v7_sb.s_time != 0)
{
xmlFSType.ModificationDate = DateHandlers.UNIXUnsignedToDateTime(v7_sb.s_time);
xmlFSType.ModificationDateSpecified = true;
}
sb.AppendFormat("Volume name: {0}", v7_sb.s_fname).AppendLine();
xmlFSType.VolumeName = v7_sb.s_fname;
sb.AppendFormat("Pack name: {0}", v7_sb.s_fpack).AppendLine();

View File

@@ -108,6 +108,8 @@ namespace DiscImageChef.Plugins
xmlFSType = new Schemas.FileSystemType();
xmlFSType.Type = "BFS";
xmlFSType.VolumeName = bfs_sb.s_volume;
xmlFSType.ClusterSize = (int)imagePlugin.GetSectorSize();
xmlFSType.Clusters = (long)(partitionEnd - partitionStart + 1);
information = sb.ToString();
}

View File

@@ -301,6 +301,7 @@ namespace DiscImageChef.Plugins
{
sb.AppendFormat("Volume was created on {0} for {1}", DateHandlers.UNIXUnsignedToDateTime(supblk.mkfs_t), ext_os).AppendLine();
xmlFSType.CreationDate = DateHandlers.UNIXUnsignedToDateTime(supblk.mkfs_t);
xmlFSType.CreationDateSpecified = true;
}
else
sb.AppendFormat("Volume was created for {0}", ext_os).AppendLine();
@@ -401,6 +402,7 @@ namespace DiscImageChef.Plugins
{
sb.AppendFormat("Last written on {0}", DateHandlers.UNIXUnsignedToDateTime(supblk.write_t)).AppendLine();
xmlFSType.ModificationDate = DateHandlers.UNIXUnsignedToDateTime(supblk.write_t);
xmlFSType.ModificationDateSpecified = true;
}
else
sb.AppendLine("Volume has never been written");
@@ -456,6 +458,7 @@ namespace DiscImageChef.Plugins
sb.AppendFormat("{0} reserved and {1} free blocks", reserved, free).AppendLine();
xmlFSType.FreeClusters = (long)free;
xmlFSType.FreeClustersSpecified = true;
sb.AppendFormat("{0} inodes with {1} free inodes ({2}%)", supblk.inodes, supblk.free_inodes, supblk.free_inodes * 100 / supblk.inodes).AppendLine();
if (supblk.first_inode > 0)
sb.AppendFormat("First inode is {0}", supblk.first_inode).AppendLine();

View File

@@ -95,7 +95,9 @@ namespace DiscImageChef.Plugins
xmlFSType = new Schemas.FileSystemType();
xmlFSType.Type = "ext";
xmlFSType.FreeClusters = ext_sb.freecountblk;
xmlFSType.FreeClustersSpecified = true;
xmlFSType.ClusterSize = 1024;
xmlFSType.Clusters = (long)((partitionEnd - partitionStart + 1) * imagePlugin.GetSectorSize() / 1024);
information = sb.ToString();
}

View File

@@ -1,3 +1,10 @@
2015-12-06 Natalia Portillo <claunia@claunia.com>
* DiskType.cs:
* DiscImageChef.Metadata.csproj:
Added method to convert DiskType to disk type and subtype
strings.
2015-12-05 Natalia Portillo <claunia@claunia.com>
* DiscImageChef.Metadata.csproj:

View File

@@ -38,6 +38,13 @@
<Compile Include="..\CICMMetadata\dotnet\cicm.cs">
<Link>cicm.cs</Link>
</Compile>
<Compile Include="DiskType.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
<ProjectReference Include="..\DiscImageChef.CommonTypes\DiscImageChef.CommonTypes.csproj">
<Project>{F2B84194-26EB-4227-B1C5-6602517E85AE}</Project>
<Name>DiscImageChef.CommonTypes</Name>
</ProjectReference>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,352 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : DiskType.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System;
namespace DiscImageChef.Metadata
{
public static class DiskType
{
public static void DiskTypeToString(CommonTypes.DiskType dskType, out string DiscType, out string DiscSubType)
{
switch (dskType)
{
case CommonTypes.DiskType.BDR:
DiscType = "BD";
DiscSubType = "BD-R";
break;
case CommonTypes.DiskType.BDRE:
DiscType = "BD";
DiscSubType = "BD-RE";
break;
case CommonTypes.DiskType.BDREXL:
DiscType = "BD";
DiscSubType = "BD-RE XL";
break;
case CommonTypes.DiskType.BDROM:
DiscType = "BD";
DiscSubType = "BD-ROM";
break;
case CommonTypes.DiskType.BDRXL:
DiscType = "BD";
DiscSubType = "BD-R XL";
break;
case CommonTypes.DiskType.CBHD:
DiscType = "BD";
DiscSubType = "CBHD";
break;
case CommonTypes.DiskType.CD:
DiscType = "CD";
DiscSubType = "CD";
break;
case CommonTypes.DiskType.CDDA:
DiscType = "CD";
DiscSubType = "CD Digital Audio";
break;
case CommonTypes.DiskType.CDEG:
DiscType = "CD";
DiscSubType = "CD+EG";
break;
case CommonTypes.DiskType.CDG:
DiscType = "CD";
DiscSubType = "CD+G";
break;
case CommonTypes.DiskType.CDI:
DiscType = "CD";
DiscSubType = "CD-i";
break;
case CommonTypes.DiskType.CDMIDI:
DiscType = "CD";
DiscSubType = "CD+MIDI";
break;
case CommonTypes.DiskType.CDMO:
DiscType = "CD";
DiscSubType = "CD-MO";
break;
case CommonTypes.DiskType.CDMRW:
DiscType = "CD";
DiscSubType = "CD-MRW";
break;
case CommonTypes.DiskType.CDPLUS:
DiscType = "CD";
DiscSubType = "CD+";
break;
case CommonTypes.DiskType.CDR:
DiscType = "CD";
DiscSubType = "CD-R";
break;
case CommonTypes.DiskType.CDROM:
DiscType = "CD-ROM";
DiscSubType = "CD";
break;
case CommonTypes.DiskType.CDROMXA:
DiscType = "CD-ROM XA";
DiscSubType = "CD";
break;
case CommonTypes.DiskType.CDRW:
DiscType = "CD-RW";
DiscSubType = "CD";
break;
case CommonTypes.DiskType.CDV:
DiscType = "CD";
DiscSubType = "CD-Video";
break;
case CommonTypes.DiskType.DDCD:
DiscType = "DDCD";
DiscSubType = "DDCD";
break;
case CommonTypes.DiskType.DDCDR:
DiscType = "DDCD";
DiscSubType = "DDCD-R";
break;
case CommonTypes.DiskType.DDCDRW:
DiscType = "DDCD";
DiscSubType = "DDCD-RW";
break;
case CommonTypes.DiskType.DTSCD:
DiscType = "CD";
DiscSubType = "DTS CD";
break;
case CommonTypes.DiskType.DVDDownload:
DiscType = "DVD";
DiscSubType = "DVD-Download";
break;
case CommonTypes.DiskType.DVDPR:
DiscType = "DVD";
DiscSubType = "DVD+R";
break;
case CommonTypes.DiskType.DVDPRDL:
DiscType = "DVD";
DiscSubType = "DVD+R DL";
break;
case CommonTypes.DiskType.DVDPRW:
DiscType = "DVD";
DiscSubType = "DVD+RW";
break;
case CommonTypes.DiskType.DVDPRWDL:
DiscType = "DVD";
DiscSubType = "DVD+RW DL";
break;
case CommonTypes.DiskType.DVDR:
DiscType = "DVD";
DiscSubType = "DVD-R";
break;
case CommonTypes.DiskType.DVDRAM:
DiscType = "DVD";
DiscSubType = "DVD-RAM";
break;
case CommonTypes.DiskType.DVDRDL:
DiscType = "DVD";
DiscSubType = "DVD-R DL";
break;
case CommonTypes.DiskType.DVDROM:
DiscType = "DVD";
DiscSubType = "DVD-ROM";
break;
case CommonTypes.DiskType.DVDRW:
DiscType = "DVD";
DiscSubType = "DVD-RW";
break;
case CommonTypes.DiskType.DVDRWDL:
DiscType = "DVD";
DiscSubType = "DVD-RW";
break;
case CommonTypes.DiskType.EVD:
DiscType = "EVD";
DiscSubType = "EVD";
break;
case CommonTypes.DiskType.FDDVD:
DiscType = "FDDVD";
DiscSubType = "FDDVD";
break;
case CommonTypes.DiskType.FVD:
DiscType = "FVD";
DiscSubType = "FVD";
break;
case CommonTypes.DiskType.GDR:
DiscType = "GD";
DiscSubType = "GD-R";
break;
case CommonTypes.DiskType.GDROM:
DiscType = "GD";
DiscSubType = "GD-ROM";
break;
case CommonTypes.DiskType.GOD:
DiscType = "DVD";
DiscSubType = "GameCube Game Disc";
break;
case CommonTypes.DiskType.WOD:
DiscType = "DVD";
DiscSubType = "Wii Optical Disc";
break;
case CommonTypes.DiskType.WUOD:
DiscType = "BD";
DiscSubType = "Wii U Optical Disc";
break;
case CommonTypes.DiskType.HDDVDR:
DiscType = "HD DVD";
DiscSubType = "HD DVD-R";
break;
case CommonTypes.DiskType.HDDVDRAM:
DiscType = "HD DVD";
DiscSubType = "HD DVD-RAM";
break;
case CommonTypes.DiskType.HDDVDRDL:
DiscType = "HD DVD";
DiscSubType = "HD DVD-R DL";
break;
case CommonTypes.DiskType.HDDVDROM:
DiscType = "HD DVD";
DiscSubType = "HD DVD-ROM";
break;
case CommonTypes.DiskType.HDDVDRW:
DiscType = "HD DVD";
DiscSubType = "HD DVD-RW";
break;
case CommonTypes.DiskType.HDDVDRWDL:
DiscType = "HD DVD";
DiscSubType = "HD DVD-RW DL";
break;
case CommonTypes.DiskType.HDVMD:
DiscType = "HD VMD";
DiscSubType = "HD VMD";
break;
case CommonTypes.DiskType.HiMD:
DiscType = "MiniDisc";
DiscSubType = "HiMD";
break;
case CommonTypes.DiskType.HVD:
DiscType = "HVD";
DiscSubType = "HVD";
break;
case CommonTypes.DiskType.LD:
DiscType = "LaserDisc";
DiscSubType = "LaserDisc";
break;
case CommonTypes.DiskType.LDROM:
DiscType = "LaserDisc";
DiscSubType = "LD-ROM";
break;
case CommonTypes.DiskType.MD:
DiscType = "MiniDisc";
DiscSubType = "MiniDisc";
break;
case CommonTypes.DiskType.MEGACD:
DiscType = "CD";
DiscSubType = "Sega Mega CD";
break;
case CommonTypes.DiskType.PCD:
DiscType = "CD";
DiscSubType = "Photo CD";
break;
case CommonTypes.DiskType.PS1CD:
DiscType = "CD";
DiscSubType = "PlayStation Game Disc";
break;
case CommonTypes.DiskType.PS2CD:
DiscType = "CD";
DiscSubType = "PlayStation 2 Game Disc";
break;
case CommonTypes.DiskType.PS2DVD:
DiscType = "DVD";
DiscSubType = "PlayStation 2 Game Disc";
break;
case CommonTypes.DiskType.PS3BD:
DiscType = "BD";
DiscSubType = "PlayStation 3 Game Disc";
break;
case CommonTypes.DiskType.PS3DVD:
DiscType = "DVD";
DiscSubType = "PlayStation 3 Game Disc";
break;
case CommonTypes.DiskType.PS4BD:
DiscType = "BD";
DiscSubType = "PlayStation 4 Game Disc";
break;
case CommonTypes.DiskType.SACD:
DiscType = "SACD";
DiscSubType = "Super Audio CD";
break;
case CommonTypes.DiskType.SATURNCD:
DiscType = "CD";
DiscSubType = "Sega Saturn CD";
break;
case CommonTypes.DiskType.SVCD:
DiscType = "CD";
DiscSubType = "Super Video CD";
break;
case CommonTypes.DiskType.SVOD:
DiscType = "SVOD";
DiscSubType = "SVOD";
break;
case CommonTypes.DiskType.UDO:
DiscType = "UDO";
DiscSubType = "UDO";
break;
case CommonTypes.DiskType.UMD:
DiscType = "UMD";
DiscSubType = "Universal Media Disc";
break;
case CommonTypes.DiskType.VCD:
DiscType = "CD";
DiscSubType = "Video CD";
break;
case CommonTypes.DiskType.XGD:
DiscType = "DVD";
DiscSubType = "Xbox Game Disc (XGD)";
break;
case CommonTypes.DiskType.XGD2:
DiscType = "DVD";
DiscSubType = "Xbox 360 Game Disc (XGD2)";
break;
case CommonTypes.DiskType.XGD3:
DiscType = "DVD";
DiscSubType = "Xbox 360 Game Disc (XGD3)";
break;
case CommonTypes.DiskType.XGD4:
DiscType = "BD";
DiscSubType = "Xbox One Game Disc (XGD4)";
break;
default:
DiscType = "Unknown";
DiscSubType = "Unknown";
break;
}
}
}
}

View File

@@ -1,3 +1,15 @@
2015-12-06 Natalia Portillo <claunia@claunia.com>
* Commands/Checksum.cs:
Checking memory usage on each step makes checksum
calculation abismally slower. Removed.
* Main.cs:
* Options.cs:
* DiscImageChef.csproj:
* Commands/CreateSidecar.cs:
Added method for creating CICM Metadata XML sidecar.
2015-12-04 Natalia Portillo <claunia@claunia.com>
* Commands/MediaInfo.cs:

View File

@@ -77,8 +77,6 @@ namespace DiscImageChef.Commands
}
inputFormat.OpenImage(options.InputFile);
long maxMemory = GC.GetTotalMemory(false);
long snapMemory;
if (inputFormat.ImageInfo.imageHasPartitions)
{
@@ -303,10 +301,6 @@ namespace DiscImageChef.Commands
spamsumThread.Start(spamsumPkt);
}
snapMemory = GC.GetTotalMemory(false);
if (snapMemory > maxMemory)
maxMemory = snapMemory;
while (adlerThread.IsAlive || crc16Thread.IsAlive ||
crc32Thread.IsAlive || crc64Thread.IsAlive ||
//fletcher16Thread.IsAlive || fletcher32Thread.IsAlive ||
@@ -330,10 +324,6 @@ namespace DiscImageChef.Commands
sha384Thread = new Thread(updateSHA384);
sha512Thread = new Thread(updateSHA512);
spamsumThread = new Thread(updateSpamSum);
snapMemory = GC.GetTotalMemory(false);
if (snapMemory > maxMemory)
maxMemory = snapMemory;
}
}
@@ -511,10 +501,6 @@ namespace DiscImageChef.Commands
spamsumThread.Start(spamsumPkt);
}
snapMemory = GC.GetTotalMemory(false);
if (snapMemory > maxMemory)
maxMemory = snapMemory;
while (adlerThread.IsAlive || crc16Thread.IsAlive ||
crc32Thread.IsAlive || crc64Thread.IsAlive ||
//fletcher16Thread.IsAlive || fletcher32Thread.IsAlive ||
@@ -538,10 +524,6 @@ namespace DiscImageChef.Commands
sha384Thread = new Thread(updateSHA384);
sha512Thread = new Thread(updateSHA512);
spamsumThread = new Thread(updateSpamSum);
snapMemory = GC.GetTotalMemory(false);
if (snapMemory > maxMemory)
maxMemory = snapMemory;
}
if (options.SeparatedTracks)
@@ -612,10 +594,6 @@ namespace DiscImageChef.Commands
spamsumThread.Start(spamsumPktTrack);
}
snapMemory = GC.GetTotalMemory(false);
if (snapMemory > maxMemory)
maxMemory = snapMemory;
while (adlerThread.IsAlive || crc16Thread.IsAlive ||
crc32Thread.IsAlive || crc64Thread.IsAlive ||
//fletcher16Thread.IsAlive || fletcher32Thread.IsAlive ||
@@ -639,10 +617,6 @@ namespace DiscImageChef.Commands
sha384Thread = new Thread(updateSHA384);
sha512Thread = new Thread(updateSHA512);
spamsumThread = new Thread(updateSpamSum);
snapMemory = GC.GetTotalMemory(false);
if (snapMemory > maxMemory)
maxMemory = snapMemory;
}
}
@@ -756,10 +730,6 @@ namespace DiscImageChef.Commands
spamsumThread.Start(spamsumPkt);
}
snapMemory = GC.GetTotalMemory(false);
if (snapMemory > maxMemory)
maxMemory = snapMemory;
while (adlerThread.IsAlive || crc16Thread.IsAlive ||
crc32Thread.IsAlive || crc64Thread.IsAlive ||
//fletcher16Thread.IsAlive || fletcher32Thread.IsAlive ||
@@ -783,10 +753,6 @@ namespace DiscImageChef.Commands
sha384Thread = new Thread(updateSHA384);
sha512Thread = new Thread(updateSHA512);
spamsumThread = new Thread(updateSpamSum);
snapMemory = GC.GetTotalMemory(false);
if (snapMemory > maxMemory)
maxMemory = snapMemory;
}
}
@@ -1025,10 +991,6 @@ namespace DiscImageChef.Commands
spamsumThread.Start(spamsumPkt);
}
snapMemory = GC.GetTotalMemory(false);
if (snapMemory > maxMemory)
maxMemory = snapMemory;
while (adlerThread.IsAlive || crc16Thread.IsAlive ||
crc32Thread.IsAlive || crc64Thread.IsAlive ||
//fletcher16Thread.IsAlive || fletcher32Thread.IsAlive ||
@@ -1052,10 +1014,6 @@ namespace DiscImageChef.Commands
sha384Thread = new Thread(updateSHA384);
sha512Thread = new Thread(updateSHA512);
spamsumThread = new Thread(updateSpamSum);
snapMemory = GC.GetTotalMemory(false);
if (snapMemory > maxMemory)
maxMemory = snapMemory;
}
DicConsole.WriteLine();
@@ -1087,8 +1045,6 @@ namespace DiscImageChef.Commands
if (options.DoSpamSum)
DicConsole.WriteLine("Disk's SpamSum: {0}", ssctx.End());
}
DicConsole.DebugWriteLine("Checksum command", "Maximum memory used has been {0} bytes", maxMemory);
}
#region Threading helpers

File diff suppressed because it is too large Load Diff

View File

@@ -34,6 +34,7 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs" />
@@ -55,6 +56,7 @@
<Compile Include="Commands\Benchmark.cs">
<Gettext-ScanForTranslations>False</Gettext-ScanForTranslations>
</Compile>
<Compile Include="Commands\CreateSidecar.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
@@ -190,5 +192,9 @@
<Project>{CCAA7AFE-C094-4D82-A66D-630DE8A3F545}</Project>
<Name>DiscImageChef.Console</Name>
</ProjectReference>
<ProjectReference Include="..\DiscImageChef.Metadata\DiscImageChef.Metadata.csproj">
<Project>{9F213318-5CB8-4066-A757-074489C9F818}</Project>
<Name>DiscImageChef.Metadata</Name>
</ProjectReference>
</ItemGroup>
</Project>

View File

@@ -170,6 +170,14 @@ namespace DiscImageChef
DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
Commands.Benchmark.doBenchmark(BenchmarkOptions);
break;
case "create-sidecar":
CreateSidecarSubOptions CreateSidecarOptions = (CreateSidecarSubOptions)invokedVerbInstance;
if (CreateSidecarOptions.Debug)
DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
if (CreateSidecarOptions.Verbose)
DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
Commands.CreateSidecar.doSidecar(CreateSidecarOptions);
break;
default:
throw new ArgumentException("Should never arrive here!");
}

View File

@@ -245,6 +245,12 @@ namespace DiscImageChef
public int BufferSize { get; set; }
}
public class CreateSidecarSubOptions : CommonSubOptions
{
[Option('i', "input", Required = true, HelpText = "Disc image.")]
public string InputFile { get; set; }
}
public class Options
{
public Options()
@@ -259,7 +265,8 @@ namespace DiscImageChef
DecodeVerb = new DecodeSubOptions();
DeviceInfoVerb = new DeviceInfoSubOptions();
MediaInfoVerb = new MediaInfoSubOptions();
BenchmarkInfoVerb = new BenchmarkSubOptions();
BenchmarkVerb = new BenchmarkSubOptions();
CreateSidecarVerb = new CreateSidecarSubOptions();
}
[VerbOption("analyze", HelpText = "Analyzes a disc image and searches for partitions and/or filesystems.")]
@@ -293,7 +300,10 @@ namespace DiscImageChef
public MediaInfoSubOptions MediaInfoVerb { get; set; }
[VerbOption("benchmark", HelpText = "Benchmarks hashing and entropy calculation.")]
public BenchmarkSubOptions BenchmarkInfoVerb { get; set; }
public BenchmarkSubOptions BenchmarkVerb { get; set; }
[VerbOption("create-sidecar", HelpText = "Creates CICM Metadata XML sidecar.")]
public CreateSidecarSubOptions CreateSidecarVerb { get; set; }
[HelpVerbOption]
public string DoHelpForVerb(string verbName)