mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Code cleanup.
This commit is contained in:
@@ -363,7 +363,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.adler32, Value = adler32Ctx.End()
|
||||
type = ChecksumTypeType.adler32,
|
||||
Value = adler32Ctx.End()
|
||||
};
|
||||
|
||||
chks.Add(chk);
|
||||
@@ -373,7 +374,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.crc16, Value = crc16Ctx.End()
|
||||
type = ChecksumTypeType.crc16,
|
||||
Value = crc16Ctx.End()
|
||||
};
|
||||
|
||||
chks.Add(chk);
|
||||
@@ -383,7 +385,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.crc32, Value = crc32Ctx.End()
|
||||
type = ChecksumTypeType.crc32,
|
||||
Value = crc32Ctx.End()
|
||||
};
|
||||
|
||||
chks.Add(chk);
|
||||
@@ -393,7 +396,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.crc64, Value = crc64Ctx.End()
|
||||
type = ChecksumTypeType.crc64,
|
||||
Value = crc64Ctx.End()
|
||||
};
|
||||
|
||||
chks.Add(chk);
|
||||
@@ -403,7 +407,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.md5, Value = md5Ctx.End()
|
||||
type = ChecksumTypeType.md5,
|
||||
Value = md5Ctx.End()
|
||||
};
|
||||
|
||||
chks.Add(chk);
|
||||
@@ -413,7 +418,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.sha1, Value = sha1Ctx.End()
|
||||
type = ChecksumTypeType.sha1,
|
||||
Value = sha1Ctx.End()
|
||||
};
|
||||
|
||||
chks.Add(chk);
|
||||
@@ -423,7 +429,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.sha256, Value = sha256Ctx.End()
|
||||
type = ChecksumTypeType.sha256,
|
||||
Value = sha256Ctx.End()
|
||||
};
|
||||
|
||||
chks.Add(chk);
|
||||
@@ -433,7 +440,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.sha384, Value = sha384Ctx.End()
|
||||
type = ChecksumTypeType.sha384,
|
||||
Value = sha384Ctx.End()
|
||||
};
|
||||
|
||||
chks.Add(chk);
|
||||
@@ -443,7 +451,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.sha512, Value = sha512Ctx.End()
|
||||
type = ChecksumTypeType.sha512,
|
||||
Value = sha512Ctx.End()
|
||||
};
|
||||
|
||||
chks.Add(chk);
|
||||
@@ -453,7 +462,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.spamsum, Value = ssctx.End()
|
||||
type = ChecksumTypeType.spamsum,
|
||||
Value = ssctx.End()
|
||||
};
|
||||
|
||||
chks.Add(chk);
|
||||
@@ -463,7 +473,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.fletcher16, Value = f16Ctx.End()
|
||||
type = ChecksumTypeType.fletcher16,
|
||||
Value = f16Ctx.End()
|
||||
};
|
||||
|
||||
chks.Add(chk);
|
||||
@@ -474,7 +485,8 @@ namespace Aaru.Core
|
||||
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.fletcher32, Value = f32Ctx.End()
|
||||
type = ChecksumTypeType.fletcher32,
|
||||
Value = f32Ctx.End()
|
||||
};
|
||||
|
||||
chks.Add(chk);
|
||||
@@ -516,7 +528,8 @@ namespace Aaru.Core
|
||||
|
||||
var adlerPktData = new HashPacket
|
||||
{
|
||||
Context = adler32CtxData, Data = data
|
||||
Context = adler32CtxData,
|
||||
Data = data
|
||||
};
|
||||
|
||||
adlerThreadData.Start(adlerPktData);
|
||||
@@ -528,7 +541,8 @@ namespace Aaru.Core
|
||||
|
||||
var crc16PktData = new HashPacket
|
||||
{
|
||||
Context = crc16CtxData, Data = data
|
||||
Context = crc16CtxData,
|
||||
Data = data
|
||||
};
|
||||
|
||||
crc16ThreadData.Start(crc16PktData);
|
||||
@@ -540,7 +554,8 @@ namespace Aaru.Core
|
||||
|
||||
var crc32PktData = new HashPacket
|
||||
{
|
||||
Context = crc32CtxData, Data = data
|
||||
Context = crc32CtxData,
|
||||
Data = data
|
||||
};
|
||||
|
||||
crc32ThreadData.Start(crc32PktData);
|
||||
@@ -552,7 +567,8 @@ namespace Aaru.Core
|
||||
|
||||
var crc64PktData = new HashPacket
|
||||
{
|
||||
Context = crc64CtxData, Data = data
|
||||
Context = crc64CtxData,
|
||||
Data = data
|
||||
};
|
||||
|
||||
crc64ThreadData.Start(crc64PktData);
|
||||
@@ -564,7 +580,8 @@ namespace Aaru.Core
|
||||
|
||||
var md5PktData = new HashPacket
|
||||
{
|
||||
Context = md5CtxData, Data = data
|
||||
Context = md5CtxData,
|
||||
Data = data
|
||||
};
|
||||
|
||||
md5ThreadData.Start(md5PktData);
|
||||
@@ -576,7 +593,8 @@ namespace Aaru.Core
|
||||
|
||||
var sha1PktData = new HashPacket
|
||||
{
|
||||
Context = sha1CtxData, Data = data
|
||||
Context = sha1CtxData,
|
||||
Data = data
|
||||
};
|
||||
|
||||
sha1ThreadData.Start(sha1PktData);
|
||||
@@ -588,7 +606,8 @@ namespace Aaru.Core
|
||||
|
||||
var sha256PktData = new HashPacket
|
||||
{
|
||||
Context = sha256CtxData, Data = data
|
||||
Context = sha256CtxData,
|
||||
Data = data
|
||||
};
|
||||
|
||||
sha256ThreadData.Start(sha256PktData);
|
||||
@@ -600,7 +619,8 @@ namespace Aaru.Core
|
||||
|
||||
var sha384PktData = new HashPacket
|
||||
{
|
||||
Context = sha384CtxData, Data = data
|
||||
Context = sha384CtxData,
|
||||
Data = data
|
||||
};
|
||||
|
||||
sha384ThreadData.Start(sha384PktData);
|
||||
@@ -612,7 +632,8 @@ namespace Aaru.Core
|
||||
|
||||
var sha512PktData = new HashPacket
|
||||
{
|
||||
Context = sha512CtxData, Data = data
|
||||
Context = sha512CtxData,
|
||||
Data = data
|
||||
};
|
||||
|
||||
sha512ThreadData.Start(sha512PktData);
|
||||
@@ -624,7 +645,8 @@ namespace Aaru.Core
|
||||
|
||||
var spamsumPktData = new HashPacket
|
||||
{
|
||||
Context = ssctxData, Data = data
|
||||
Context = ssctxData,
|
||||
Data = data
|
||||
};
|
||||
|
||||
spamsumThreadData.Start(spamsumPktData);
|
||||
@@ -636,7 +658,8 @@ namespace Aaru.Core
|
||||
|
||||
var f16PktData = new HashPacket
|
||||
{
|
||||
Context = f16CtxData, Data = data
|
||||
Context = f16CtxData,
|
||||
Data = data
|
||||
};
|
||||
|
||||
f16ThreadData.Start(f16PktData);
|
||||
@@ -648,7 +671,8 @@ namespace Aaru.Core
|
||||
|
||||
var f32PktData = new HashPacket
|
||||
{
|
||||
Context = f32CtxData, Data = data
|
||||
Context = f32CtxData,
|
||||
Data = data
|
||||
};
|
||||
|
||||
f32ThreadData.Start(f32PktData);
|
||||
@@ -674,7 +698,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.adler32, Value = adler32CtxData.End()
|
||||
type = ChecksumTypeType.adler32,
|
||||
Value = adler32CtxData.End()
|
||||
};
|
||||
|
||||
dataChecksums.Add(chk);
|
||||
@@ -684,7 +709,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.crc16, Value = crc16CtxData.End()
|
||||
type = ChecksumTypeType.crc16,
|
||||
Value = crc16CtxData.End()
|
||||
};
|
||||
|
||||
dataChecksums.Add(chk);
|
||||
@@ -694,7 +720,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.crc32, Value = crc32CtxData.End()
|
||||
type = ChecksumTypeType.crc32,
|
||||
Value = crc32CtxData.End()
|
||||
};
|
||||
|
||||
dataChecksums.Add(chk);
|
||||
@@ -704,7 +731,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.crc64, Value = crc64CtxData.End()
|
||||
type = ChecksumTypeType.crc64,
|
||||
Value = crc64CtxData.End()
|
||||
};
|
||||
|
||||
dataChecksums.Add(chk);
|
||||
@@ -714,7 +742,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.md5, Value = md5CtxData.End()
|
||||
type = ChecksumTypeType.md5,
|
||||
Value = md5CtxData.End()
|
||||
};
|
||||
|
||||
dataChecksums.Add(chk);
|
||||
@@ -724,7 +753,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.sha1, Value = sha1CtxData.End()
|
||||
type = ChecksumTypeType.sha1,
|
||||
Value = sha1CtxData.End()
|
||||
};
|
||||
|
||||
dataChecksums.Add(chk);
|
||||
@@ -734,7 +764,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.sha256, Value = sha256CtxData.End()
|
||||
type = ChecksumTypeType.sha256,
|
||||
Value = sha256CtxData.End()
|
||||
};
|
||||
|
||||
dataChecksums.Add(chk);
|
||||
@@ -744,7 +775,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.sha384, Value = sha384CtxData.End()
|
||||
type = ChecksumTypeType.sha384,
|
||||
Value = sha384CtxData.End()
|
||||
};
|
||||
|
||||
dataChecksums.Add(chk);
|
||||
@@ -754,7 +786,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.sha512, Value = sha512CtxData.End()
|
||||
type = ChecksumTypeType.sha512,
|
||||
Value = sha512CtxData.End()
|
||||
};
|
||||
|
||||
dataChecksums.Add(chk);
|
||||
@@ -764,7 +797,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.spamsum, Value = ssctxData.End()
|
||||
type = ChecksumTypeType.spamsum,
|
||||
Value = ssctxData.End()
|
||||
};
|
||||
|
||||
dataChecksums.Add(chk);
|
||||
@@ -774,7 +808,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.fletcher16, Value = f16CtxData.End()
|
||||
type = ChecksumTypeType.fletcher16,
|
||||
Value = f16CtxData.End()
|
||||
};
|
||||
|
||||
dataChecksums.Add(chk);
|
||||
@@ -784,7 +819,8 @@ namespace Aaru.Core
|
||||
{
|
||||
chk = new ChecksumType
|
||||
{
|
||||
type = ChecksumTypeType.fletcher32, Value = f32CtxData.End()
|
||||
type = ChecksumTypeType.fletcher32,
|
||||
Value = f32CtxData.End()
|
||||
};
|
||||
|
||||
dataChecksums.Add(chk);
|
||||
|
||||
@@ -587,7 +587,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
// TODO: Non-removable
|
||||
var metadata = new CommonTypes.Structs.ImageInfo
|
||||
{
|
||||
Application = "Aaru", ApplicationVersion = Version.GetVersion()
|
||||
Application = "Aaru",
|
||||
ApplicationVersion = Version.GetVersion()
|
||||
};
|
||||
|
||||
if(!_outputPlugin.SetMetadata(metadata))
|
||||
@@ -659,12 +660,14 @@ namespace Aaru.Core.Devices.Dumping
|
||||
if(ret)
|
||||
sidecar.BlockMedia[0].USB = new USBType
|
||||
{
|
||||
ProductID = _dev.UsbProductId, VendorID = _dev.UsbVendorId, Descriptors =
|
||||
new DumpType
|
||||
{
|
||||
Image = _outputPath, Size = (ulong)_dev.UsbDescriptors.Length,
|
||||
Checksums = Checksum.GetChecksums(_dev.UsbDescriptors).ToArray()
|
||||
}
|
||||
ProductID = _dev.UsbProductId,
|
||||
VendorID = _dev.UsbVendorId,
|
||||
Descriptors = new DumpType
|
||||
{
|
||||
Image = _outputPath,
|
||||
Size = (ulong)_dev.UsbDescriptors.Length,
|
||||
Checksums = Checksum.GetChecksums(_dev.UsbDescriptors).ToArray()
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -680,7 +683,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
CIS = new DumpType
|
||||
{
|
||||
Image = _outputPath, Size = (ulong)_dev.Cis.Length,
|
||||
Image = _outputPath,
|
||||
Size = (ulong)_dev.Cis.Length,
|
||||
Checksums = Checksum.GetChecksums(_dev.Cis).ToArray()
|
||||
}
|
||||
};
|
||||
@@ -736,7 +740,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
Identify = new DumpType
|
||||
{
|
||||
Image = _outputPath, Size = (ulong)cmdBuf.Length,
|
||||
Image = _outputPath,
|
||||
Size = (ulong)cmdBuf.Length,
|
||||
Checksums = Checksum.GetChecksums(cmdBuf).ToArray()
|
||||
}
|
||||
};
|
||||
@@ -766,7 +771,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
if(filesystems.Count > 0)
|
||||
foreach(var filesystem in filesystems.Select(o => new
|
||||
{
|
||||
o.start, o.type
|
||||
o.start,
|
||||
o.type
|
||||
}).Distinct())
|
||||
{
|
||||
UpdateStatus?.
|
||||
|
||||
@@ -515,10 +515,14 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
new Track
|
||||
{
|
||||
TrackSequence = 0, TrackSession = 1, TrackType = hiddenData ? TrackType.Data : TrackType.Audio,
|
||||
TrackStartSector = 0, TrackBytesPerSector = (int)sectorSize,
|
||||
TrackRawBytesPerSector = (int)sectorSize, TrackSubchannelType = subType,
|
||||
TrackEndSector = tracks.First(t => t.TrackSequence == 1).TrackStartSector - 1
|
||||
TrackSequence = 0,
|
||||
TrackSession = 1,
|
||||
TrackType = hiddenData ? TrackType.Data : TrackType.Audio,
|
||||
TrackStartSector = 0,
|
||||
TrackBytesPerSector = (int)sectorSize,
|
||||
TrackRawBytesPerSector = (int)sectorSize,
|
||||
TrackSubchannelType = subType,
|
||||
TrackEndSector = tracks.First(t => t.TrackSequence == 1).TrackStartSector - 1
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1231,7 +1235,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
// TODO: Disc ID
|
||||
var metadata = new CommonTypes.Structs.ImageInfo
|
||||
{
|
||||
Application = "Aaru", ApplicationVersion = Version.GetVersion()
|
||||
Application = "Aaru",
|
||||
ApplicationVersion = Version.GetVersion()
|
||||
};
|
||||
|
||||
if(!_outputPlugin.SetMetadata(metadata))
|
||||
|
||||
@@ -141,27 +141,36 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
pgMmc = new Modes.ModePage_01_MMC
|
||||
{
|
||||
PS = false, ReadRetryCount = 32, Parameter = 0x00
|
||||
PS = false,
|
||||
ReadRetryCount = 32,
|
||||
Parameter = 0x00
|
||||
};
|
||||
|
||||
currentModePage = new Modes.ModePage
|
||||
{
|
||||
Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01_MMC(pgMmc)
|
||||
Page = 0x01,
|
||||
Subpage = 0x00,
|
||||
PageResponse = Modes.EncodeModePage_01_MMC(pgMmc)
|
||||
};
|
||||
}
|
||||
|
||||
pgMmc = new Modes.ModePage_01_MMC
|
||||
{
|
||||
PS = false, ReadRetryCount = 255, Parameter = 0x20
|
||||
PS = false,
|
||||
ReadRetryCount = 255,
|
||||
Parameter = 0x20
|
||||
};
|
||||
|
||||
var md = new Modes.DecodedMode
|
||||
{
|
||||
Header = new Modes.ModeHeader(), Pages = new[]
|
||||
Header = new Modes.ModeHeader(),
|
||||
Pages = new[]
|
||||
{
|
||||
new Modes.ModePage
|
||||
{
|
||||
Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01_MMC(pgMmc)
|
||||
Page = 0x01,
|
||||
Subpage = 0x00,
|
||||
PageResponse = Modes.EncodeModePage_01_MMC(pgMmc)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -345,16 +354,21 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
var pgMmc = new Modes.ModePage_01_MMC
|
||||
{
|
||||
PS = false, ReadRetryCount = 255, Parameter = 0x01
|
||||
PS = false,
|
||||
ReadRetryCount = 255,
|
||||
Parameter = 0x01
|
||||
};
|
||||
|
||||
var md = new Modes.DecodedMode
|
||||
{
|
||||
Header = new Modes.ModeHeader(), Pages = new[]
|
||||
Header = new Modes.ModeHeader(),
|
||||
Pages = new[]
|
||||
{
|
||||
new Modes.ModePage
|
||||
{
|
||||
Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01_MMC(pgMmc)
|
||||
Page = 0x01,
|
||||
Subpage = 0x00,
|
||||
PageResponse = Modes.EncodeModePage_01_MMC(pgMmc)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -452,7 +466,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
var md = new Modes.DecodedMode
|
||||
{
|
||||
Header = new Modes.ModeHeader(), Pages = new[]
|
||||
Header = new Modes.ModeHeader(),
|
||||
Pages = new[]
|
||||
{
|
||||
currentModePage.Value
|
||||
}
|
||||
|
||||
@@ -111,7 +111,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
trackList.Add(new Track
|
||||
{
|
||||
TrackSequence = trk.POINT, TrackSession = trk.SessionNumber,
|
||||
TrackSequence = trk.POINT,
|
||||
TrackSession = trk.SessionNumber,
|
||||
TrackType = (TocControl)(trk.CONTROL & 0x0D) == TocControl.DataTrack ||
|
||||
(TocControl)(trk.CONTROL & 0x0D) == TocControl.DataTrackIncremental
|
||||
? TrackType.Data : TrackType.Audio,
|
||||
@@ -202,12 +203,15 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
trackList.Add(new Track
|
||||
{
|
||||
TrackSequence = trk.TrackNumber, TrackSession = 1,
|
||||
TrackSequence = trk.TrackNumber,
|
||||
TrackSession = 1,
|
||||
TrackType = (TocControl)(trk.CONTROL & 0x0D) == TocControl.DataTrack ||
|
||||
(TocControl)(trk.CONTROL & 0x0D) == TocControl.DataTrackIncremental
|
||||
? TrackType.Data : TrackType.Audio,
|
||||
TrackStartSector = trk.TrackStartAddress, TrackBytesPerSector = (int)sectorSize,
|
||||
TrackRawBytesPerSector = (int)sectorSize, TrackSubchannelType = subType
|
||||
TrackStartSector = trk.TrackStartAddress,
|
||||
TrackBytesPerSector = (int)sectorSize,
|
||||
TrackRawBytesPerSector = (int)sectorSize,
|
||||
TrackSubchannelType = subType
|
||||
});
|
||||
|
||||
trackFlags?.Add(trk.TrackNumber, trk.CONTROL);
|
||||
@@ -230,10 +234,13 @@ namespace Aaru.Core.Devices.Dumping
|
||||
|
||||
trackList.Add(new Track
|
||||
{
|
||||
TrackSequence = 1, TrackSession = 1, TrackType = leadoutTrackType,
|
||||
TrackStartSector = 0,
|
||||
TrackBytesPerSector = (int)sectorSize, TrackRawBytesPerSector = (int)sectorSize,
|
||||
TrackSubchannelType = subType
|
||||
TrackSequence = 1,
|
||||
TrackSession = 1,
|
||||
TrackType = leadoutTrackType,
|
||||
TrackStartSector = 0,
|
||||
TrackBytesPerSector = (int)sectorSize,
|
||||
TrackRawBytesPerSector = (int)sectorSize,
|
||||
TrackSubchannelType = subType
|
||||
});
|
||||
|
||||
trackFlags?.Add(1, (byte)(leadoutTrackType == TrackType.Audio ? 0 : 4));
|
||||
|
||||
@@ -67,6 +67,7 @@ namespace Aaru.Core.Devices.Dumping
|
||||
readonly bool _fixSubchannelPosition;
|
||||
readonly bool _force;
|
||||
readonly Dictionary<string, string> _formatOptions;
|
||||
readonly bool _generateSubchannels;
|
||||
readonly bool _metadata;
|
||||
readonly string _outputPath;
|
||||
readonly IWritableImage _outputPlugin;
|
||||
@@ -84,7 +85,6 @@ namespace Aaru.Core.Devices.Dumping
|
||||
Database.Models.Device _dbDev; // Device database entry
|
||||
bool _dumpFirstTrackPregap;
|
||||
bool _fixOffset;
|
||||
readonly bool _generateSubchannels;
|
||||
uint _maximumReadable; // Maximum number of sectors drive can read at once
|
||||
Resume _resume;
|
||||
Sidecar _sidecarClass;
|
||||
|
||||
@@ -701,7 +701,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
case MediaTagType.DVD_PFI:
|
||||
sidecar.OpticalDisc[0].PFI = new DumpType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
};
|
||||
|
||||
@@ -709,7 +710,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
case MediaTagType.DVD_DMI:
|
||||
sidecar.OpticalDisc[0].DMI = new DumpType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
};
|
||||
|
||||
@@ -718,7 +720,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
case MediaTagType.HDDVD_CPI:
|
||||
sidecar.OpticalDisc[0].CMI = new DumpType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
};
|
||||
|
||||
@@ -738,7 +741,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
case MediaTagType.BD_BCA:
|
||||
sidecar.OpticalDisc[0].BCA = new DumpType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
};
|
||||
|
||||
@@ -747,7 +751,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
case MediaTagType.DVDRAM_DDS:
|
||||
sidecar.OpticalDisc[0].DDS = new DumpType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
};
|
||||
|
||||
@@ -756,7 +761,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
case MediaTagType.BD_SpareArea:
|
||||
sidecar.OpticalDisc[0].SAI = new DumpType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
};
|
||||
|
||||
@@ -764,7 +770,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
case MediaTagType.DVDR_PreRecordedInfo:
|
||||
sidecar.OpticalDisc[0].PRI = new DumpType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
};
|
||||
|
||||
@@ -772,7 +779,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
case MediaTagType.DVD_MediaIdentifier:
|
||||
sidecar.OpticalDisc[0].MediaID = new DumpType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
};
|
||||
|
||||
@@ -780,7 +788,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
case MediaTagType.DVDR_PFI:
|
||||
sidecar.OpticalDisc[0].PFIR = new DumpType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
};
|
||||
|
||||
@@ -788,7 +797,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
case MediaTagType.DVD_ADIP:
|
||||
sidecar.OpticalDisc[0].ADIP = new DumpType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
};
|
||||
|
||||
@@ -796,7 +806,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
case MediaTagType.DCB:
|
||||
sidecar.OpticalDisc[0].DCB = new DumpType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
};
|
||||
|
||||
@@ -804,7 +815,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
case MediaTagType.BD_DI:
|
||||
sidecar.OpticalDisc[0].DI = new DumpType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
};
|
||||
|
||||
@@ -817,9 +829,12 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
new XboxSecuritySectorsType
|
||||
{
|
||||
RequestNumber = 0, RequestVersion = 1, SecuritySectors = new DumpType
|
||||
RequestNumber = 0,
|
||||
RequestVersion = 1,
|
||||
SecuritySectors = new DumpType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
}
|
||||
}
|
||||
@@ -832,7 +847,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
|
||||
sidecar.OpticalDisc[0].Xbox.PFI = new DumpType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
};
|
||||
|
||||
@@ -843,7 +859,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
|
||||
sidecar.OpticalDisc[0].Xbox.DMI = new DumpType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
};
|
||||
|
||||
@@ -851,7 +868,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
case MediaTagType.CD_FullTOC:
|
||||
sidecar.OpticalDisc[0].TOC = new DumpType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
};
|
||||
|
||||
@@ -859,7 +877,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
case MediaTagType.CD_ATIP:
|
||||
sidecar.OpticalDisc[0].ATIP = new DumpType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
};
|
||||
|
||||
@@ -867,7 +886,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
case MediaTagType.CD_PMA:
|
||||
sidecar.OpticalDisc[0].PMA = new DumpType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
};
|
||||
|
||||
@@ -875,7 +895,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
case MediaTagType.CD_TEXT:
|
||||
sidecar.OpticalDisc[0].LeadInCdText = new DumpType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
};
|
||||
|
||||
@@ -885,7 +906,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
new BorderType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
}
|
||||
};
|
||||
@@ -896,7 +918,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
new BorderType
|
||||
{
|
||||
Image = outputPath, Size = (ulong)tag.Value.Length,
|
||||
Image = outputPath,
|
||||
Size = (ulong)tag.Value.Length,
|
||||
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
|
||||
}
|
||||
};
|
||||
|
||||
@@ -113,7 +113,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
if(filesystems.Count > 0)
|
||||
foreach(var filesystem in filesystems.Select(o => new
|
||||
{
|
||||
o.start, o.type
|
||||
o.start,
|
||||
o.type
|
||||
}).Distinct())
|
||||
_dumpLog.WriteLine("Found filesystem {0} at sector {1}", filesystem.type, filesystem.start);
|
||||
|
||||
|
||||
@@ -511,31 +511,50 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
pg = new Modes.ModePage_01
|
||||
{
|
||||
PS = false, AWRE = true, ARRE = true, TB = false,
|
||||
RC = false, EER = true, PER = false, DTE = true,
|
||||
DCR = false, ReadRetryCount = 32
|
||||
PS = false,
|
||||
AWRE = true,
|
||||
ARRE = true,
|
||||
TB = false,
|
||||
RC = false,
|
||||
EER = true,
|
||||
PER = false,
|
||||
DTE = true,
|
||||
DCR = false,
|
||||
ReadRetryCount = 32
|
||||
};
|
||||
|
||||
currentModePage = new Modes.ModePage
|
||||
{
|
||||
Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01(pg)
|
||||
Page = 0x01,
|
||||
Subpage = 0x00,
|
||||
PageResponse = Modes.EncodeModePage_01(pg)
|
||||
};
|
||||
}
|
||||
|
||||
pg = new Modes.ModePage_01
|
||||
{
|
||||
PS = false, AWRE = false, ARRE = false, TB = true,
|
||||
RC = false, EER = true, PER = false, DTE = false,
|
||||
DCR = false, ReadRetryCount = 255
|
||||
PS = false,
|
||||
AWRE = false,
|
||||
ARRE = false,
|
||||
TB = true,
|
||||
RC = false,
|
||||
EER = true,
|
||||
PER = false,
|
||||
DTE = false,
|
||||
DCR = false,
|
||||
ReadRetryCount = 255
|
||||
};
|
||||
|
||||
var md = new Modes.DecodedMode
|
||||
{
|
||||
Header = new Modes.ModeHeader(), Pages = new[]
|
||||
Header = new Modes.ModeHeader(),
|
||||
Pages = new[]
|
||||
{
|
||||
new Modes.ModePage
|
||||
{
|
||||
Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01(pg)
|
||||
Page = 0x01,
|
||||
Subpage = 0x00,
|
||||
PageResponse = Modes.EncodeModePage_01(pg)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -615,7 +634,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
var md = new Modes.DecodedMode
|
||||
{
|
||||
Header = new Modes.ModeHeader(), Pages = new[]
|
||||
Header = new Modes.ModeHeader(),
|
||||
Pages = new[]
|
||||
{
|
||||
currentModePage.Value
|
||||
}
|
||||
@@ -643,7 +663,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
|
||||
var metadata = new CommonTypes.Structs.ImageInfo
|
||||
{
|
||||
Application = "Aaru", ApplicationVersion = Version.GetVersion()
|
||||
Application = "Aaru",
|
||||
ApplicationVersion = Version.GetVersion()
|
||||
};
|
||||
|
||||
if(!_outputPlugin.SetMetadata(metadata))
|
||||
@@ -725,7 +746,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
if(filesystems.Count > 0)
|
||||
foreach(var filesystem in filesystems.Select(o => new
|
||||
{
|
||||
o.start, o.type
|
||||
o.start,
|
||||
o.type
|
||||
}).Distinct())
|
||||
{
|
||||
UpdateStatus?.Invoke($"Found filesystem {filesystem.type} at sector {filesystem.start}");
|
||||
|
||||
@@ -371,31 +371,50 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
pg = new Modes.ModePage_01
|
||||
{
|
||||
PS = false, AWRE = true, ARRE = true, TB = false,
|
||||
RC = false, EER = true, PER = false, DTE = true,
|
||||
DCR = false, ReadRetryCount = 32
|
||||
PS = false,
|
||||
AWRE = true,
|
||||
ARRE = true,
|
||||
TB = false,
|
||||
RC = false,
|
||||
EER = true,
|
||||
PER = false,
|
||||
DTE = true,
|
||||
DCR = false,
|
||||
ReadRetryCount = 32
|
||||
};
|
||||
|
||||
currentModePage = new Modes.ModePage
|
||||
{
|
||||
Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01(pg)
|
||||
Page = 0x01,
|
||||
Subpage = 0x00,
|
||||
PageResponse = Modes.EncodeModePage_01(pg)
|
||||
};
|
||||
}
|
||||
|
||||
pg = new Modes.ModePage_01
|
||||
{
|
||||
PS = false, AWRE = false, ARRE = false, TB = true,
|
||||
RC = false, EER = true, PER = false, DTE = false,
|
||||
DCR = false, ReadRetryCount = 255
|
||||
PS = false,
|
||||
AWRE = false,
|
||||
ARRE = false,
|
||||
TB = true,
|
||||
RC = false,
|
||||
EER = true,
|
||||
PER = false,
|
||||
DTE = false,
|
||||
DCR = false,
|
||||
ReadRetryCount = 255
|
||||
};
|
||||
|
||||
var md = new Modes.DecodedMode
|
||||
{
|
||||
Header = new Modes.ModeHeader(), Pages = new[]
|
||||
Header = new Modes.ModeHeader(),
|
||||
Pages = new[]
|
||||
{
|
||||
new Modes.ModePage
|
||||
{
|
||||
Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01(pg)
|
||||
Page = 0x01,
|
||||
Subpage = 0x00,
|
||||
PageResponse = Modes.EncodeModePage_01(pg)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -477,7 +496,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
var md = new Modes.DecodedMode
|
||||
{
|
||||
Header = new Modes.ModeHeader(), Pages = new[]
|
||||
Header = new Modes.ModeHeader(),
|
||||
Pages = new[]
|
||||
{
|
||||
currentModePage.Value
|
||||
}
|
||||
@@ -503,7 +523,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
|
||||
var metadata = new CommonTypes.Structs.ImageInfo
|
||||
{
|
||||
Application = "Aaru", ApplicationVersion = Version.GetVersion()
|
||||
Application = "Aaru",
|
||||
ApplicationVersion = Version.GetVersion()
|
||||
};
|
||||
|
||||
if(!_outputPlugin.SetMetadata(metadata))
|
||||
@@ -587,7 +608,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
if(filesystems.Count > 0)
|
||||
foreach(var filesystem in filesystems.Select(o => new
|
||||
{
|
||||
o.start, o.type
|
||||
o.start,
|
||||
o.type
|
||||
}).Distinct())
|
||||
{
|
||||
UpdateStatus?.Invoke($"Found filesystem {filesystem.type} at sector {filesystem.start}");
|
||||
|
||||
@@ -156,9 +156,13 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
new Track
|
||||
{
|
||||
TrackBytesPerSector = (int)BLOCK_SIZE, TrackEndSector = blocks - 1, TrackSequence = 1,
|
||||
TrackRawBytesPerSector = (int)BLOCK_SIZE, TrackSubchannelType = TrackSubchannelType.None,
|
||||
TrackSession = 1, TrackType = TrackType.Data
|
||||
TrackBytesPerSector = (int)BLOCK_SIZE,
|
||||
TrackEndSector = blocks - 1,
|
||||
TrackSequence = 1,
|
||||
TrackRawBytesPerSector = (int)BLOCK_SIZE,
|
||||
TrackSubchannelType = TrackSubchannelType.None,
|
||||
TrackSession = 1,
|
||||
TrackType = TrackType.Data
|
||||
}
|
||||
});
|
||||
|
||||
@@ -372,31 +376,50 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
pg = new Modes.ModePage_01
|
||||
{
|
||||
PS = false, AWRE = true, ARRE = true, TB = false,
|
||||
RC = false, EER = true, PER = false, DTE = true,
|
||||
DCR = false, ReadRetryCount = 32
|
||||
PS = false,
|
||||
AWRE = true,
|
||||
ARRE = true,
|
||||
TB = false,
|
||||
RC = false,
|
||||
EER = true,
|
||||
PER = false,
|
||||
DTE = true,
|
||||
DCR = false,
|
||||
ReadRetryCount = 32
|
||||
};
|
||||
|
||||
currentModePage = new Modes.ModePage
|
||||
{
|
||||
Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01(pg)
|
||||
Page = 0x01,
|
||||
Subpage = 0x00,
|
||||
PageResponse = Modes.EncodeModePage_01(pg)
|
||||
};
|
||||
}
|
||||
|
||||
pg = new Modes.ModePage_01
|
||||
{
|
||||
PS = false, AWRE = false, ARRE = false, TB = true,
|
||||
RC = false, EER = true, PER = false, DTE = false,
|
||||
DCR = false, ReadRetryCount = 255
|
||||
PS = false,
|
||||
AWRE = false,
|
||||
ARRE = false,
|
||||
TB = true,
|
||||
RC = false,
|
||||
EER = true,
|
||||
PER = false,
|
||||
DTE = false,
|
||||
DCR = false,
|
||||
ReadRetryCount = 255
|
||||
};
|
||||
|
||||
var md = new Modes.DecodedMode
|
||||
{
|
||||
Header = new Modes.ModeHeader(), Pages = new[]
|
||||
Header = new Modes.ModeHeader(),
|
||||
Pages = new[]
|
||||
{
|
||||
new Modes.ModePage
|
||||
{
|
||||
Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01(pg)
|
||||
Page = 0x01,
|
||||
Subpage = 0x00,
|
||||
PageResponse = Modes.EncodeModePage_01(pg)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -480,7 +503,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
var md = new Modes.DecodedMode
|
||||
{
|
||||
Header = new Modes.ModeHeader(), Pages = new[]
|
||||
Header = new Modes.ModeHeader(),
|
||||
Pages = new[]
|
||||
{
|
||||
currentModePage.Value
|
||||
}
|
||||
@@ -506,7 +530,9 @@ namespace Aaru.Core.Devices.Dumping
|
||||
|
||||
var metadata = new CommonTypes.Structs.ImageInfo
|
||||
{
|
||||
Application = "Aaru", ApplicationVersion = Version.GetVersion(), MediaPartNumber = mediaPartNumber
|
||||
Application = "Aaru",
|
||||
ApplicationVersion = Version.GetVersion(),
|
||||
MediaPartNumber = mediaPartNumber
|
||||
};
|
||||
|
||||
if(!_outputPlugin.SetMetadata(metadata))
|
||||
|
||||
@@ -131,9 +131,11 @@ namespace Aaru.Core.Devices.Dumping
|
||||
|
||||
currentTry = new DumpHardwareType
|
||||
{
|
||||
Software = CommonTypes.Metadata.Version.GetSoftwareType(), Manufacturer = manufacturer,
|
||||
Model = model, Serial = serial,
|
||||
Firmware = firmware
|
||||
Software = CommonTypes.Metadata.Version.GetSoftwareType(),
|
||||
Manufacturer = manufacturer,
|
||||
Model = model,
|
||||
Serial = serial,
|
||||
Firmware = firmware
|
||||
};
|
||||
|
||||
resume.Tries.Add(currentTry);
|
||||
@@ -143,16 +145,20 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
resume = new Resume
|
||||
{
|
||||
Tries = new List<DumpHardwareType>(), CreationDate = DateTime.UtcNow,
|
||||
BadBlocks = new List<ulong>(),
|
||||
LastBlock = isTape ? 0 : blocks - 1, Tape = isTape
|
||||
Tries = new List<DumpHardwareType>(),
|
||||
CreationDate = DateTime.UtcNow,
|
||||
BadBlocks = new List<ulong>(),
|
||||
LastBlock = isTape ? 0 : blocks - 1,
|
||||
Tape = isTape
|
||||
};
|
||||
|
||||
currentTry = new DumpHardwareType
|
||||
{
|
||||
Software = CommonTypes.Metadata.Version.GetSoftwareType(), Manufacturer = manufacturer,
|
||||
Model = model, Serial = serial,
|
||||
Firmware = firmware
|
||||
Software = CommonTypes.Metadata.Version.GetSoftwareType(),
|
||||
Manufacturer = manufacturer,
|
||||
Model = model,
|
||||
Serial = serial,
|
||||
Firmware = firmware
|
||||
};
|
||||
|
||||
resume.Tries.Add(currentTry);
|
||||
|
||||
@@ -449,9 +449,11 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
TrackSequence = trkInfo.LogicalTrackNumber,
|
||||
TrackSession = (ushort)(canStoreNotCdSessions ? trkInfo.SessionNumber : 1),
|
||||
TrackType = TrackType.Data, TrackStartSector = trkInfo.LogicalTrackStartAddress,
|
||||
TrackType = TrackType.Data,
|
||||
TrackStartSector = trkInfo.LogicalTrackStartAddress,
|
||||
TrackEndSector = (trkInfo.LogicalTrackSize + trkInfo.LogicalTrackStartAddress) - 1,
|
||||
TrackRawBytesPerSector = (int)blockSize, TrackBytesPerSector = (int)blockSize,
|
||||
TrackRawBytesPerSector = (int)blockSize,
|
||||
TrackBytesPerSector = (int)blockSize,
|
||||
TrackSubchannelType = TrackSubchannelType.None
|
||||
};
|
||||
|
||||
@@ -487,10 +489,13 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
new Track
|
||||
{
|
||||
TrackBytesPerSector = (int)blockSize, TrackEndSector = blocks - 1,
|
||||
TrackSequence = 1, TrackRawBytesPerSector = (int)blockSize,
|
||||
TrackSubchannelType = TrackSubchannelType.None, TrackSession = 1,
|
||||
TrackType = TrackType.Data
|
||||
TrackBytesPerSector = (int)blockSize,
|
||||
TrackEndSector = blocks - 1,
|
||||
TrackSequence = 1,
|
||||
TrackRawBytesPerSector = (int)blockSize,
|
||||
TrackSubchannelType = TrackSubchannelType.None,
|
||||
TrackSession = 1,
|
||||
TrackType = TrackType.Data
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -807,26 +812,39 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
pgMmc = new Modes.ModePage_01_MMC
|
||||
{
|
||||
PS = false, ReadRetryCount = 32, Parameter = 0x00
|
||||
PS = false,
|
||||
ReadRetryCount = 32,
|
||||
Parameter = 0x00
|
||||
};
|
||||
|
||||
currentModePage = new Modes.ModePage
|
||||
{
|
||||
Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01_MMC(pgMmc)
|
||||
Page = 0x01,
|
||||
Subpage = 0x00,
|
||||
PageResponse = Modes.EncodeModePage_01_MMC(pgMmc)
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
pg = new Modes.ModePage_01
|
||||
{
|
||||
PS = false, AWRE = true, ARRE = true, TB = false,
|
||||
RC = false, EER = true, PER = false, DTE = true,
|
||||
DCR = false, ReadRetryCount = 32
|
||||
PS = false,
|
||||
AWRE = true,
|
||||
ARRE = true,
|
||||
TB = false,
|
||||
RC = false,
|
||||
EER = true,
|
||||
PER = false,
|
||||
DTE = true,
|
||||
DCR = false,
|
||||
ReadRetryCount = 32
|
||||
};
|
||||
|
||||
currentModePage = new Modes.ModePage
|
||||
{
|
||||
Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01(pg)
|
||||
Page = 0x01,
|
||||
Subpage = 0x00,
|
||||
PageResponse = Modes.EncodeModePage_01(pg)
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -835,16 +853,21 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
pgMmc = new Modes.ModePage_01_MMC
|
||||
{
|
||||
PS = false, ReadRetryCount = 255, Parameter = 0x20
|
||||
PS = false,
|
||||
ReadRetryCount = 255,
|
||||
Parameter = 0x20
|
||||
};
|
||||
|
||||
var md = new Modes.DecodedMode
|
||||
{
|
||||
Header = new Modes.ModeHeader(), Pages = new[]
|
||||
Header = new Modes.ModeHeader(),
|
||||
Pages = new[]
|
||||
{
|
||||
new Modes.ModePage
|
||||
{
|
||||
Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01_MMC(pgMmc)
|
||||
Page = 0x01,
|
||||
Subpage = 0x00,
|
||||
PageResponse = Modes.EncodeModePage_01_MMC(pgMmc)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -856,18 +879,28 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
pg = new Modes.ModePage_01
|
||||
{
|
||||
PS = false, AWRE = false, ARRE = false, TB = true,
|
||||
RC = false, EER = true, PER = false, DTE = false,
|
||||
DCR = false, ReadRetryCount = 255
|
||||
PS = false,
|
||||
AWRE = false,
|
||||
ARRE = false,
|
||||
TB = true,
|
||||
RC = false,
|
||||
EER = true,
|
||||
PER = false,
|
||||
DTE = false,
|
||||
DCR = false,
|
||||
ReadRetryCount = 255
|
||||
};
|
||||
|
||||
var md = new Modes.DecodedMode
|
||||
{
|
||||
Header = new Modes.ModeHeader(), Pages = new[]
|
||||
Header = new Modes.ModeHeader(),
|
||||
Pages = new[]
|
||||
{
|
||||
new Modes.ModePage
|
||||
{
|
||||
Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01(pg)
|
||||
Page = 0x01,
|
||||
Subpage = 0x00,
|
||||
PageResponse = Modes.EncodeModePage_01(pg)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -954,7 +987,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
var md = new Modes.DecodedMode
|
||||
{
|
||||
Header = new Modes.ModeHeader(), Pages = new[]
|
||||
Header = new Modes.ModeHeader(),
|
||||
Pages = new[]
|
||||
{
|
||||
currentModePage.Value
|
||||
}
|
||||
@@ -1152,7 +1186,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
// TODO: Non-removable drive information
|
||||
var metadata = new CommonTypes.Structs.ImageInfo
|
||||
{
|
||||
Application = "Aaru", ApplicationVersion = Version.GetVersion()
|
||||
Application = "Aaru",
|
||||
ApplicationVersion = Version.GetVersion()
|
||||
};
|
||||
|
||||
if(!_outputPlugin.SetMetadata(metadata))
|
||||
@@ -1238,12 +1273,14 @@ namespace Aaru.Core.Devices.Dumping
|
||||
if(_outputPlugin.SupportedMediaTags.Contains(MediaTagType.USB_Descriptors))
|
||||
sidecar.BlockMedia[0].USB = new USBType
|
||||
{
|
||||
ProductID = _dev.UsbProductId, VendorID = _dev.UsbVendorId, Descriptors =
|
||||
new DumpType
|
||||
{
|
||||
Image = _outputPath, Size = (ulong)_dev.UsbDescriptors.Length,
|
||||
Checksums = Checksum.GetChecksums(_dev.UsbDescriptors).ToArray()
|
||||
}
|
||||
ProductID = _dev.UsbProductId,
|
||||
VendorID = _dev.UsbVendorId,
|
||||
Descriptors = new DumpType
|
||||
{
|
||||
Image = _outputPath,
|
||||
Size = (ulong)_dev.UsbDescriptors.Length,
|
||||
Checksums = Checksum.GetChecksums(_dev.UsbDescriptors).ToArray()
|
||||
}
|
||||
};
|
||||
|
||||
byte[] cmdBuf;
|
||||
@@ -1258,7 +1295,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
Identify = new DumpType
|
||||
{
|
||||
Image = _outputPath, Size = (ulong)cmdBuf.Length,
|
||||
Image = _outputPath,
|
||||
Size = (ulong)cmdBuf.Length,
|
||||
Checksums = Checksum.GetChecksums(cmdBuf).ToArray()
|
||||
}
|
||||
};
|
||||
@@ -1273,7 +1311,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
Inquiry = new DumpType
|
||||
{
|
||||
Image = _outputPath, Size = (ulong)cmdBuf.Length,
|
||||
Image = _outputPath,
|
||||
Size = (ulong)cmdBuf.Length,
|
||||
Checksums = Checksum.GetChecksums(cmdBuf).ToArray()
|
||||
}
|
||||
};
|
||||
@@ -1331,7 +1370,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
if(_outputPlugin.SupportedMediaTags.Contains(MediaTagType.SCSI_MODESENSE_10))
|
||||
sidecar.BlockMedia[0].SCSI.ModeSense10 = new DumpType
|
||||
{
|
||||
Image = _outputPath, Size = (ulong)cmdBuf.Length,
|
||||
Image = _outputPath,
|
||||
Size = (ulong)cmdBuf.Length,
|
||||
Checksums = Checksum.GetChecksums(cmdBuf).ToArray()
|
||||
};
|
||||
|
||||
@@ -1354,7 +1394,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
if(_outputPlugin.SupportedMediaTags.Contains(MediaTagType.SCSI_MODESENSE_6))
|
||||
sidecar.BlockMedia[0].SCSI.ModeSense = new DumpType
|
||||
{
|
||||
Image = _outputPath, Size = (ulong)cmdBuf.Length,
|
||||
Image = _outputPath,
|
||||
Size = (ulong)cmdBuf.Length,
|
||||
Checksums = Checksum.GetChecksums(cmdBuf).ToArray()
|
||||
};
|
||||
}
|
||||
@@ -1371,7 +1412,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
if(filesystems.Count > 0)
|
||||
foreach(var filesystem in filesystems.Select(o => new
|
||||
{
|
||||
o.start, o.type
|
||||
o.start,
|
||||
o.type
|
||||
}).Distinct())
|
||||
{
|
||||
UpdateStatus?.Invoke($"Found filesystem {filesystem.type} at sector {filesystem.start}");
|
||||
|
||||
@@ -764,12 +764,15 @@ namespace Aaru.Core.Devices.Dumping
|
||||
|
||||
var currentTapeFile = new TapeFile
|
||||
{
|
||||
File = currentFile, FirstBlock = currentBlock, Partition = currentPartition
|
||||
File = currentFile,
|
||||
FirstBlock = currentBlock,
|
||||
Partition = currentPartition
|
||||
};
|
||||
|
||||
var currentTapePartition = new TapePartition
|
||||
{
|
||||
Number = currentPartition, FirstBlock = currentBlock
|
||||
Number = currentPartition,
|
||||
FirstBlock = currentBlock
|
||||
};
|
||||
|
||||
if((canLocate || canLocateLong) &&
|
||||
@@ -834,12 +837,15 @@ namespace Aaru.Core.Devices.Dumping
|
||||
|
||||
currentTapeFile = new TapeFile
|
||||
{
|
||||
File = currentFile, FirstBlock = currentBlock, Partition = currentPartition
|
||||
File = currentFile,
|
||||
FirstBlock = currentBlock,
|
||||
Partition = currentPartition
|
||||
};
|
||||
|
||||
currentTapePartition = new TapePartition
|
||||
{
|
||||
Number = currentPartition, FirstBlock = currentBlock
|
||||
Number = currentPartition,
|
||||
FirstBlock = currentBlock
|
||||
};
|
||||
|
||||
UpdateStatus?.Invoke($"Seeking to partition {currentPartition}");
|
||||
@@ -958,7 +964,9 @@ namespace Aaru.Core.Devices.Dumping
|
||||
|
||||
currentTapeFile = new TapeFile
|
||||
{
|
||||
File = currentFile, FirstBlock = currentBlock, Partition = currentPartition
|
||||
File = currentFile,
|
||||
FirstBlock = currentBlock,
|
||||
Partition = currentPartition
|
||||
};
|
||||
|
||||
UpdateStatus?.Invoke($"Changed to file {currentFile} at block {currentBlock}");
|
||||
@@ -1219,7 +1227,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
// TODO: Media Serial Number
|
||||
var metadata = new CommonTypes.Structs.ImageInfo
|
||||
{
|
||||
Application = "Aaru", ApplicationVersion = Version.GetVersion()
|
||||
Application = "Aaru",
|
||||
ApplicationVersion = Version.GetVersion()
|
||||
};
|
||||
|
||||
if(!_outputPlugin.SetMetadata(metadata))
|
||||
@@ -1309,7 +1318,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
if(filesystems.Count > 0)
|
||||
foreach(var filesystem in filesystems.Select(o => new
|
||||
{
|
||||
o.start, o.type
|
||||
o.start,
|
||||
o.type
|
||||
}).Distinct())
|
||||
{
|
||||
UpdateStatus?.Invoke($"Found filesystem {filesystem.type} at sector {filesystem.start}");
|
||||
|
||||
@@ -559,7 +559,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
// TODO: Drive info
|
||||
var metadata = new CommonTypes.Structs.ImageInfo
|
||||
{
|
||||
Application = "Aaru", ApplicationVersion = Version.GetVersion()
|
||||
Application = "Aaru",
|
||||
ApplicationVersion = Version.GetVersion()
|
||||
};
|
||||
|
||||
if(!_outputPlugin.SetMetadata(metadata))
|
||||
@@ -655,7 +656,9 @@ namespace Aaru.Core.Devices.Dumping
|
||||
|
||||
cidDump = new DumpType
|
||||
{
|
||||
Image = _outputPath, Size = (ulong)cid.Length, Checksums = Checksum.GetChecksums(cid).ToArray()
|
||||
Image = _outputPath,
|
||||
Size = (ulong)cid.Length,
|
||||
Checksums = Checksum.GetChecksums(cid).ToArray()
|
||||
};
|
||||
|
||||
ret =
|
||||
@@ -680,7 +683,9 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
csdDump = new DumpType
|
||||
{
|
||||
Image = _outputPath, Size = (ulong)csd.Length, Checksums = Checksum.GetChecksums(csd).ToArray()
|
||||
Image = _outputPath,
|
||||
Size = (ulong)csd.Length,
|
||||
Checksums = Checksum.GetChecksums(csd).ToArray()
|
||||
};
|
||||
|
||||
ret =
|
||||
@@ -705,7 +710,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
sidecar.BlockMedia[0].MultiMediaCard.ExtendedCSD = new DumpType
|
||||
{
|
||||
Image = _outputPath, Size = (ulong)ecsd.Length,
|
||||
Image = _outputPath,
|
||||
Size = (ulong)ecsd.Length,
|
||||
Checksums = Checksum.GetChecksums(ecsd).ToArray()
|
||||
};
|
||||
|
||||
@@ -728,7 +734,9 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
ocrDump = new DumpType
|
||||
{
|
||||
Image = _outputPath, Size = (ulong)ocr.Length, Checksums = Checksum.GetChecksums(ocr).ToArray()
|
||||
Image = _outputPath,
|
||||
Size = (ulong)ocr.Length,
|
||||
Checksums = Checksum.GetChecksums(ocr).ToArray()
|
||||
};
|
||||
|
||||
ret =
|
||||
@@ -753,7 +761,9 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
sidecar.BlockMedia[0].SecureDigital.SCR = new DumpType
|
||||
{
|
||||
Image = _outputPath, Size = (ulong)scr.Length, Checksums = Checksum.GetChecksums(scr).ToArray()
|
||||
Image = _outputPath,
|
||||
Size = (ulong)scr.Length,
|
||||
Checksums = Checksum.GetChecksums(scr).ToArray()
|
||||
};
|
||||
|
||||
ret = _outputPlugin.WriteMediaTag(scr, MediaTagType.SD_SCR);
|
||||
|
||||
@@ -493,9 +493,13 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
new Track
|
||||
{
|
||||
TrackBytesPerSector = (int)BLOCK_SIZE, TrackEndSector = blocks - 1, TrackSequence = 1,
|
||||
TrackRawBytesPerSector = (int)BLOCK_SIZE, TrackSubchannelType = TrackSubchannelType.None,
|
||||
TrackSession = 1, TrackType = TrackType.Data
|
||||
TrackBytesPerSector = (int)BLOCK_SIZE,
|
||||
TrackEndSector = blocks - 1,
|
||||
TrackSequence = 1,
|
||||
TrackRawBytesPerSector = (int)BLOCK_SIZE,
|
||||
TrackSubchannelType = TrackSubchannelType.None,
|
||||
TrackSession = 1,
|
||||
TrackType = TrackType.Data
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1002,27 +1006,36 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
pgMmc = new Modes.ModePage_01_MMC
|
||||
{
|
||||
PS = false, ReadRetryCount = 0x20, Parameter = 0x00
|
||||
PS = false,
|
||||
ReadRetryCount = 0x20,
|
||||
Parameter = 0x00
|
||||
};
|
||||
|
||||
currentModePage = new Modes.ModePage
|
||||
{
|
||||
Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01_MMC(pgMmc)
|
||||
Page = 0x01,
|
||||
Subpage = 0x00,
|
||||
PageResponse = Modes.EncodeModePage_01_MMC(pgMmc)
|
||||
};
|
||||
}
|
||||
|
||||
pgMmc = new Modes.ModePage_01_MMC
|
||||
{
|
||||
PS = false, ReadRetryCount = 255, Parameter = 0x20
|
||||
PS = false,
|
||||
ReadRetryCount = 255,
|
||||
Parameter = 0x20
|
||||
};
|
||||
|
||||
var md = new Modes.DecodedMode
|
||||
{
|
||||
Header = new Modes.ModeHeader(), Pages = new[]
|
||||
Header = new Modes.ModeHeader(),
|
||||
Pages = new[]
|
||||
{
|
||||
new Modes.ModePage
|
||||
{
|
||||
Page = 0x01, Subpage = 0x00, PageResponse = Modes.EncodeModePage_01_MMC(pgMmc)
|
||||
Page = 0x01,
|
||||
Subpage = 0x00,
|
||||
PageResponse = Modes.EncodeModePage_01_MMC(pgMmc)
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1109,7 +1122,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
var md = new Modes.DecodedMode
|
||||
{
|
||||
Header = new Modes.ModeHeader(), Pages = new[]
|
||||
Header = new Modes.ModeHeader(),
|
||||
Pages = new[]
|
||||
{
|
||||
currentModePage.Value
|
||||
}
|
||||
@@ -1167,7 +1181,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
|
||||
var metadata = new CommonTypes.Structs.ImageInfo
|
||||
{
|
||||
Application = "Aaru", ApplicationVersion = Version.GetVersion()
|
||||
Application = "Aaru",
|
||||
ApplicationVersion = Version.GetVersion()
|
||||
};
|
||||
|
||||
if(!_outputPlugin.SetMetadata(metadata))
|
||||
@@ -1199,7 +1214,9 @@ namespace Aaru.Core.Devices.Dumping
|
||||
{
|
||||
var layers = new LayersType
|
||||
{
|
||||
type = LayersTypeType.OTP, typeSpecified = true, Sectors = new SectorsType[1]
|
||||
type = LayersTypeType.OTP,
|
||||
typeSpecified = true,
|
||||
Sectors = new SectorsType[1]
|
||||
};
|
||||
|
||||
layers.Sectors[0] = new SectorsType
|
||||
|
||||
@@ -73,7 +73,9 @@ namespace Aaru.Core.Devices.Report
|
||||
{
|
||||
mediaTest.CHS = new Chs
|
||||
{
|
||||
Cylinders = ataId.Cylinders, Heads = ataId.Heads, Sectors = ataId.SectorsPerTrack
|
||||
Cylinders = ataId.Cylinders,
|
||||
Heads = ataId.Heads,
|
||||
Sectors = ataId.SectorsPerTrack
|
||||
};
|
||||
|
||||
mediaTest.Blocks = (ulong)(ataId.Cylinders * ataId.Heads * ataId.SectorsPerTrack);
|
||||
@@ -85,7 +87,8 @@ namespace Aaru.Core.Devices.Report
|
||||
{
|
||||
mediaTest.CurrentCHS = new Chs
|
||||
{
|
||||
Cylinders = ataId.CurrentCylinders, Heads = ataId.CurrentHeads,
|
||||
Cylinders = ataId.CurrentCylinders,
|
||||
Heads = ataId.CurrentHeads,
|
||||
Sectors = ataId.CurrentSectorsPerTrack
|
||||
};
|
||||
|
||||
@@ -351,8 +354,7 @@ namespace Aaru.Core.Devices.Report
|
||||
_dev.Timeout, out _);
|
||||
|
||||
mediaTest.SupportsReadLongRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
|
||||
readBuf.Length > 0 &&
|
||||
BitConverter.ToUInt64(readBuf, 0) !=
|
||||
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) !=
|
||||
checkCorrectRead;
|
||||
|
||||
AaruConsole.DebugWriteLine("ATA Report",
|
||||
@@ -414,7 +416,9 @@ namespace Aaru.Core.Devices.Report
|
||||
{
|
||||
capabilities.CHS = new Chs
|
||||
{
|
||||
Cylinders = ataId.Cylinders, Heads = ataId.Heads, Sectors = ataId.SectorsPerTrack
|
||||
Cylinders = ataId.Cylinders,
|
||||
Heads = ataId.Heads,
|
||||
Sectors = ataId.SectorsPerTrack
|
||||
};
|
||||
|
||||
capabilities.Blocks = (ulong)(ataId.Cylinders * ataId.Heads * ataId.SectorsPerTrack);
|
||||
@@ -426,7 +430,8 @@ namespace Aaru.Core.Devices.Report
|
||||
{
|
||||
capabilities.CurrentCHS = new Chs
|
||||
{
|
||||
Cylinders = ataId.CurrentCylinders, Heads = ataId.CurrentHeads,
|
||||
Cylinders = ataId.CurrentCylinders,
|
||||
Heads = ataId.CurrentHeads,
|
||||
Sectors = ataId.CurrentSectorsPerTrack
|
||||
};
|
||||
|
||||
@@ -665,10 +670,8 @@ namespace Aaru.Core.Devices.Report
|
||||
sense = _dev.ReadLong(out readBuf, out errorChs, false, 0, 0, 1, capabilities.LongBlockSize ?? 0,
|
||||
_dev.Timeout, out _);
|
||||
|
||||
capabilities.SupportsReadLong = !sense && (errorChs.Status & 0x01) != 0x01 &&
|
||||
errorChs.Error == 0 &&
|
||||
readBuf.Length > 0 &&
|
||||
BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
|
||||
capabilities.SupportsReadLong = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
|
||||
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) != checkCorrectRead;
|
||||
|
||||
AaruConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
sense, errorChs.Status, errorChs.Error, readBuf.Length);
|
||||
@@ -681,8 +684,7 @@ namespace Aaru.Core.Devices.Report
|
||||
_dev.Timeout, out _);
|
||||
|
||||
capabilities.SupportsReadLongRetry = !sense && (errorChs.Status & 0x01) != 0x01 && errorChs.Error == 0 &&
|
||||
readBuf.Length > 0 &&
|
||||
BitConverter.ToUInt64(readBuf, 0) !=
|
||||
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) !=
|
||||
checkCorrectRead;
|
||||
|
||||
AaruConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
@@ -710,8 +712,7 @@ namespace Aaru.Core.Devices.Report
|
||||
out _);
|
||||
|
||||
capabilities.SupportsReadLongRetryLba = !sense && (errorLba.Status & 0x01) != 0x01 && errorLba.Error == 0 &&
|
||||
readBuf.Length > 0 &&
|
||||
BitConverter.ToUInt64(readBuf, 0) !=
|
||||
readBuf.Length > 0 && BitConverter.ToUInt64(readBuf, 0) !=
|
||||
checkCorrectRead;
|
||||
|
||||
AaruConsole.DebugWriteLine("ATA Report", "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}",
|
||||
|
||||
@@ -40,7 +40,9 @@ namespace Aaru.Core.Devices.Report
|
||||
/// <summary>Fills a device report with parameters specific to a FireWire device</summary>
|
||||
public FireWire FireWireReport() => new FireWire
|
||||
{
|
||||
Manufacturer = _dev.FireWireVendorName, Product = _dev.FireWireModelName, ProductID = _dev.FireWireModel,
|
||||
Manufacturer = _dev.FireWireVendorName,
|
||||
Product = _dev.FireWireModelName,
|
||||
ProductID = _dev.FireWireModel,
|
||||
VendorID = _dev.FireWireVendor
|
||||
};
|
||||
}
|
||||
|
||||
@@ -82,11 +82,13 @@ namespace Aaru.Core.Devices.Report
|
||||
Capacity = dsh.Value.descriptors[i].capacity,
|
||||
DefaultDensity = dsh.Value.descriptors[i].defaultDensity,
|
||||
Description = dsh.Value.descriptors[i].description,
|
||||
Duplicate = dsh.Value.descriptors[i].duplicate, Name = dsh.Value.descriptors[i].name,
|
||||
Duplicate = dsh.Value.descriptors[i].duplicate,
|
||||
Name = dsh.Value.descriptors[i].name,
|
||||
Organization = dsh.Value.descriptors[i].organization,
|
||||
PrimaryCode = dsh.Value.descriptors[i].primaryCode,
|
||||
SecondaryCode = dsh.Value.descriptors[i].secondaryCode,
|
||||
Tracks = dsh.Value.descriptors[i].tracks, Width = dsh.Value.descriptors[i].width,
|
||||
Tracks = dsh.Value.descriptors[i].tracks,
|
||||
Width = dsh.Value.descriptors[i].width,
|
||||
Writable = dsh.Value.descriptors[i].writable
|
||||
};
|
||||
|
||||
@@ -111,9 +113,12 @@ namespace Aaru.Core.Devices.Report
|
||||
{
|
||||
array2[i] = new SscSupportedMedia
|
||||
{
|
||||
Description = mtsh.Value.descriptors[i].description, Length = mtsh.Value.descriptors[i].length,
|
||||
MediumType = mtsh.Value.descriptors[i].mediumType, Name = mtsh.Value.descriptors[i].name,
|
||||
Organization = mtsh.Value.descriptors[i].organization, Width = mtsh.Value.descriptors[i].width
|
||||
Description = mtsh.Value.descriptors[i].description,
|
||||
Length = mtsh.Value.descriptors[i].length,
|
||||
MediumType = mtsh.Value.descriptors[i].mediumType,
|
||||
Name = mtsh.Value.descriptors[i].name,
|
||||
Organization = mtsh.Value.descriptors[i].organization,
|
||||
Width = mtsh.Value.descriptors[i].width
|
||||
};
|
||||
|
||||
if(mtsh.Value.descriptors[i].densityCodes == null)
|
||||
@@ -192,11 +197,13 @@ namespace Aaru.Core.Devices.Report
|
||||
Capacity = dsh.Value.descriptors[i].capacity,
|
||||
DefaultDensity = dsh.Value.descriptors[i].defaultDensity,
|
||||
Description = dsh.Value.descriptors[i].description,
|
||||
Duplicate = dsh.Value.descriptors[i].duplicate, Name = dsh.Value.descriptors[i].name,
|
||||
Duplicate = dsh.Value.descriptors[i].duplicate,
|
||||
Name = dsh.Value.descriptors[i].name,
|
||||
Organization = dsh.Value.descriptors[i].organization,
|
||||
PrimaryCode = dsh.Value.descriptors[i].primaryCode,
|
||||
SecondaryCode = dsh.Value.descriptors[i].secondaryCode,
|
||||
Tracks = dsh.Value.descriptors[i].tracks, Width = dsh.Value.descriptors[i].width,
|
||||
Tracks = dsh.Value.descriptors[i].tracks,
|
||||
Width = dsh.Value.descriptors[i].width,
|
||||
Writable = dsh.Value.descriptors[i].writable
|
||||
};
|
||||
|
||||
@@ -221,7 +228,8 @@ namespace Aaru.Core.Devices.Report
|
||||
{
|
||||
Description = mtsh.Value.descriptors[i].description,
|
||||
Length = mtsh.Value.descriptors[i].length,
|
||||
MediumType = mtsh.Value.descriptors[i].mediumType, Name = mtsh.Value.descriptors[i].name,
|
||||
MediumType = mtsh.Value.descriptors[i].mediumType,
|
||||
Name = mtsh.Value.descriptors[i].name,
|
||||
Organization = mtsh.Value.descriptors[i].organization,
|
||||
Width = mtsh.Value.descriptors[i].width
|
||||
};
|
||||
|
||||
@@ -145,7 +145,8 @@ namespace Aaru.Core.Devices.Report
|
||||
|
||||
var evpd = new ScsiPage
|
||||
{
|
||||
page = page, value = buffer
|
||||
page = page,
|
||||
value = buffer
|
||||
};
|
||||
|
||||
evpds.Add(evpd);
|
||||
@@ -326,7 +327,8 @@ namespace Aaru.Core.Devices.Report
|
||||
|
||||
report.SCSI.ModeSense = new ScsiMode
|
||||
{
|
||||
BlankCheckEnabled = decMode.Value.Header.EBC, DPOandFUA = decMode.Value.Header.DPOFUA,
|
||||
BlankCheckEnabled = decMode.Value.Header.EBC,
|
||||
DPOandFUA = decMode.Value.Header.DPOFUA,
|
||||
WriteProtected = decMode.Value.Header.WriteProtected
|
||||
};
|
||||
|
||||
@@ -345,7 +347,9 @@ namespace Aaru.Core.Devices.Report
|
||||
{
|
||||
var modePage = new ScsiPage
|
||||
{
|
||||
page = page.Page, subpage = page.Subpage, value = page.PageResponse
|
||||
page = page.Page,
|
||||
subpage = page.Subpage,
|
||||
value = page.PageResponse
|
||||
};
|
||||
|
||||
modePages.Add(modePage);
|
||||
|
||||
@@ -42,8 +42,11 @@ namespace Aaru.Core.Devices.Report
|
||||
{
|
||||
var usbReport = new Usb
|
||||
{
|
||||
Manufacturer = _dev.UsbManufacturerString, Product = _dev.UsbProductString,
|
||||
ProductID = _dev.UsbProductId, VendorID = _dev.UsbVendorId, Descriptors = _dev.UsbDescriptors
|
||||
Manufacturer = _dev.UsbManufacturerString,
|
||||
Product = _dev.UsbProductString,
|
||||
ProductID = _dev.UsbProductId,
|
||||
VendorID = _dev.UsbVendorId,
|
||||
Descriptors = _dev.UsbDescriptors
|
||||
};
|
||||
|
||||
return usbReport;
|
||||
|
||||
@@ -240,8 +240,7 @@ namespace Aaru.Core.Devices.Scanning
|
||||
mhddLog.Close();
|
||||
|
||||
ibgLog.Close(_dev, results.Blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
(blockSize * (double)(results.Blocks + 1)) / 1024 /
|
||||
(results.ProcessingTime / 1000),
|
||||
(blockSize * (double)(results.Blocks + 1)) / 1024 / (results.ProcessingTime / 1000),
|
||||
_devicePath);
|
||||
|
||||
InitProgress?.Invoke();
|
||||
|
||||
@@ -81,7 +81,8 @@ namespace Aaru.Core
|
||||
{
|
||||
var trackEntropy = new EntropyResults
|
||||
{
|
||||
Track = currentTrack.TrackSequence, Entropy = 0
|
||||
Track = currentTrack.TrackSequence,
|
||||
Entropy = 0
|
||||
};
|
||||
|
||||
UpdateProgressEvent?.
|
||||
|
||||
@@ -112,8 +112,7 @@ namespace Aaru.Core.Logging
|
||||
byte[] scanblocksizeBytes = Encoding.ASCII.GetBytes(scanblocksize);
|
||||
byte[] verBytes = Encoding.ASCII.GetBytes(MHDD_VER);
|
||||
|
||||
uint pointer = (uint)(deviceBytes.Length + modeBytes.Length + fwBytes.Length +
|
||||
snBytes.Length +
|
||||
uint pointer = (uint)(deviceBytes.Length + modeBytes.Length + fwBytes.Length + snBytes.Length +
|
||||
sectorsBytes.Length + sectorsizeBytes.Length + scanblocksizeBytes.Length +
|
||||
verBytes.Length + (2 * 9) + // New lines
|
||||
4); // Pointer
|
||||
|
||||
@@ -1382,8 +1382,12 @@ namespace Aaru.Core.Media.Info
|
||||
|
||||
XgdInfo = new XgdInfo
|
||||
{
|
||||
L0Video = l0Video, L1Video = l1Video, MiddleZone = middleZone, GameSize = gameSize,
|
||||
TotalSize = totalSize, LayerBreak = layerBreak
|
||||
L0Video = l0Video,
|
||||
L1Video = l1Video,
|
||||
MiddleZone = middleZone,
|
||||
GameSize = gameSize,
|
||||
TotalSize = totalSize,
|
||||
LayerBreak = layerBreak
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -332,8 +332,9 @@ namespace Aaru.Core
|
||||
|
||||
existing = new Device(device)
|
||||
{
|
||||
Id = device.Id, OptimalMultipleSectorsRead = device.OptimalMultipleSectorsRead,
|
||||
CanReadGdRomUsingSwapDisc = device.CanReadGdRomUsingSwapDisc
|
||||
Id = device.Id,
|
||||
OptimalMultipleSectorsRead = device.OptimalMultipleSectorsRead,
|
||||
CanReadGdRomUsingSwapDisc = device.CanReadGdRomUsingSwapDisc
|
||||
};
|
||||
|
||||
mctx.Devices.Add(existing);
|
||||
@@ -344,8 +345,9 @@ namespace Aaru.Core
|
||||
|
||||
mctx.Devices.Add(new Device(device)
|
||||
{
|
||||
Id = device.Id, OptimalMultipleSectorsRead = device.OptimalMultipleSectorsRead,
|
||||
CanReadGdRomUsingSwapDisc = device.CanReadGdRomUsingSwapDisc
|
||||
Id = device.Id,
|
||||
OptimalMultipleSectorsRead = device.OptimalMultipleSectorsRead,
|
||||
CanReadGdRomUsingSwapDisc = device.CanReadGdRomUsingSwapDisc
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,11 +58,16 @@ namespace Aaru.Core
|
||||
{
|
||||
new AudioMediaType
|
||||
{
|
||||
Checksums = imgChecksums.ToArray(), Image = new ImageType
|
||||
Checksums = imgChecksums.ToArray(),
|
||||
Image = new ImageType
|
||||
{
|
||||
format = image.Format, offset = 0, offsetSpecified = true, Value = Path.GetFileName(imagePath)
|
||||
format = image.Format,
|
||||
offset = 0,
|
||||
offsetSpecified = true,
|
||||
Value = Path.GetFileName(imagePath)
|
||||
},
|
||||
Size = (ulong)fi.Length, Sequence = new SequenceType
|
||||
Size = (ulong)fi.Length,
|
||||
Sequence = new SequenceType
|
||||
{
|
||||
MediaTitle = image.Info.MediaTitle
|
||||
}
|
||||
|
||||
@@ -71,11 +71,16 @@ namespace Aaru.Core
|
||||
{
|
||||
new BlockMediaType
|
||||
{
|
||||
Checksums = imgChecksums.ToArray(), Image = new ImageType
|
||||
Checksums = imgChecksums.ToArray(),
|
||||
Image = new ImageType
|
||||
{
|
||||
format = image.Format, offset = 0, offsetSpecified = true, Value = Path.GetFileName(imagePath)
|
||||
format = image.Format,
|
||||
offset = 0,
|
||||
offsetSpecified = true,
|
||||
Value = Path.GetFileName(imagePath)
|
||||
},
|
||||
Size = (ulong)fi.Length, Sequence = new SequenceType
|
||||
Size = (ulong)fi.Length,
|
||||
Sequence = new SequenceType
|
||||
{
|
||||
MediaTitle = image.Info.MediaTitle
|
||||
}
|
||||
@@ -134,7 +139,8 @@ namespace Aaru.Core
|
||||
{
|
||||
CIS = new DumpType
|
||||
{
|
||||
Checksums = Checksum.GetChecksums(cis).ToArray(), Size = (ulong)cis.Length
|
||||
Checksums = Checksum.GetChecksums(cis).ToArray(),
|
||||
Size = (ulong)cis.Length
|
||||
}
|
||||
};
|
||||
|
||||
@@ -395,8 +401,10 @@ namespace Aaru.Core
|
||||
{
|
||||
var thisPartition = new TapePartitionType
|
||||
{
|
||||
Image = sidecar.BlockMedia[0].Image, Sequence = tapePartition.Number,
|
||||
StartBlock = tapePartition.FirstBlock, EndBlock = tapePartition.LastBlock
|
||||
Image = sidecar.BlockMedia[0].Image,
|
||||
Sequence = tapePartition.Number,
|
||||
StartBlock = tapePartition.FirstBlock,
|
||||
EndBlock = tapePartition.LastBlock
|
||||
};
|
||||
|
||||
if(tapeImage.TapePartitions.Count == 1)
|
||||
@@ -466,9 +474,12 @@ namespace Aaru.Core
|
||||
{
|
||||
var thisFile = new TapeFileType
|
||||
{
|
||||
Sequence = tapeFile.File, StartBlock = tapeFile.FirstBlock,
|
||||
EndBlock = tapeFile.LastBlock,
|
||||
Image = sidecar.BlockMedia[0].Image, Size = 0, BlockSize = 0
|
||||
Sequence = tapeFile.File,
|
||||
StartBlock = tapeFile.FirstBlock,
|
||||
EndBlock = tapeFile.LastBlock,
|
||||
Image = sidecar.BlockMedia[0].Image,
|
||||
Size = 0,
|
||||
BlockSize = 0
|
||||
};
|
||||
|
||||
if(tapeImage.Files.Count(f => f.Partition == tapePartition.Number) == 1)
|
||||
@@ -569,9 +580,12 @@ namespace Aaru.Core
|
||||
|
||||
sidecar.BlockMedia[0].FileSystemInformation[i] = new PartitionType
|
||||
{
|
||||
Description = partitions[i].Description, EndSector = partitions[i].End,
|
||||
Name = partitions[i].Name, Sequence = (uint)partitions[i].Sequence,
|
||||
StartSector = partitions[i].Start, Type = partitions[i].Type
|
||||
Description = partitions[i].Description,
|
||||
EndSector = partitions[i].End,
|
||||
Name = partitions[i].Name,
|
||||
Sequence = (uint)partitions[i].Sequence,
|
||||
StartSector = partitions[i].Start,
|
||||
Type = partitions[i].Type
|
||||
};
|
||||
|
||||
List<FileSystemType> lstFs = new List<FileSystemType>();
|
||||
@@ -618,13 +632,15 @@ namespace Aaru.Core
|
||||
|
||||
sidecar.BlockMedia[0].FileSystemInformation[0] = new PartitionType
|
||||
{
|
||||
StartSector = 0, EndSector = image.Info.Sectors - 1
|
||||
StartSector = 0,
|
||||
EndSector = image.Info.Sectors - 1
|
||||
};
|
||||
|
||||
var wholePart = new Partition
|
||||
{
|
||||
Name = "Whole device", Length = image.Info.Sectors,
|
||||
Size = image.Info.Sectors * image.Info.SectorSize
|
||||
Name = "Whole device",
|
||||
Length = image.Info.Sectors,
|
||||
Size = image.Info.Sectors * image.Info.SectorSize
|
||||
};
|
||||
|
||||
List<FileSystemType> lstFs = new List<FileSystemType>();
|
||||
@@ -875,12 +891,14 @@ namespace Aaru.Core
|
||||
|
||||
var scpBlockTrackType = new BlockTrackType
|
||||
{
|
||||
Cylinder = t / image.Info.Heads, Head = (ushort)(t % image.Info.Heads), Image =
|
||||
new ImageType
|
||||
{
|
||||
format = scpImage.Format, Value = Path.GetFileName(scpFilePath),
|
||||
offset = scpImage.Header.offsets[t]
|
||||
}
|
||||
Cylinder = t / image.Info.Heads,
|
||||
Head = (ushort)(t % image.Info.Heads),
|
||||
Image = new ImageType
|
||||
{
|
||||
format = scpImage.Format,
|
||||
Value = Path.GetFileName(scpFilePath),
|
||||
offset = scpImage.Header.offsets[t]
|
||||
}
|
||||
};
|
||||
|
||||
if(scpBlockTrackType.Cylinder < image.Info.Cylinders)
|
||||
@@ -981,7 +999,8 @@ namespace Aaru.Core
|
||||
|
||||
var kfBlockTrackType = new BlockTrackType
|
||||
{
|
||||
Cylinder = kvp.Key / image.Info.Heads, Head = (ushort)(kvp.Key % image.Info.Heads),
|
||||
Cylinder = kvp.Key / image.Info.Heads,
|
||||
Head = (ushort)(kvp.Key % image.Info.Heads),
|
||||
Image = new ImageType
|
||||
{
|
||||
format = kfImage.Format,
|
||||
@@ -1067,11 +1086,13 @@ namespace Aaru.Core
|
||||
|
||||
var dfiBlockTrackType = new BlockTrackType
|
||||
{
|
||||
Cylinder = (uint)(t / image.Info.Heads), Head = (ushort)(t % image.Info.Heads), Image =
|
||||
new ImageType
|
||||
{
|
||||
format = dfiImage.Format, Value = Path.GetFileName(dfiFilePath)
|
||||
}
|
||||
Cylinder = (uint)(t / image.Info.Heads),
|
||||
Head = (ushort)(t % image.Info.Heads),
|
||||
Image = new ImageType
|
||||
{
|
||||
format = dfiImage.Format,
|
||||
Value = Path.GetFileName(dfiFilePath)
|
||||
}
|
||||
};
|
||||
|
||||
if(dfiBlockTrackType.Cylinder < image.Info.Cylinders)
|
||||
|
||||
@@ -52,19 +52,27 @@ namespace Aaru.Core
|
||||
{
|
||||
Image = new ImageType
|
||||
{
|
||||
format = "Directory", offsetSpecified = false, Value = folderName
|
||||
format = "Directory",
|
||||
offsetSpecified = false,
|
||||
Value = folderName
|
||||
},
|
||||
Sequence = new SequenceType
|
||||
{
|
||||
MediaTitle = folderName, MediaSequence = 1, TotalMedia = 1
|
||||
MediaTitle = folderName,
|
||||
MediaSequence = 1,
|
||||
TotalMedia = 1
|
||||
},
|
||||
PhysicalBlockSize = blockSize, LogicalBlockSize = blockSize, TapeInformation = new[]
|
||||
PhysicalBlockSize = blockSize,
|
||||
LogicalBlockSize = blockSize,
|
||||
TapeInformation = new[]
|
||||
{
|
||||
new TapePartitionType
|
||||
{
|
||||
Image = new ImageType
|
||||
{
|
||||
format = "Directory", offsetSpecified = false, Value = folderName
|
||||
format = "Directory",
|
||||
offsetSpecified = false,
|
||||
Value = folderName
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -94,10 +102,14 @@ namespace Aaru.Core
|
||||
{
|
||||
Image = new ImageType
|
||||
{
|
||||
format = "Raw disk image (sector by sector copy)", offset = 0,
|
||||
format = "Raw disk image (sector by sector copy)",
|
||||
offset = 0,
|
||||
Value = Path.GetFileName(files[i])
|
||||
},
|
||||
Size = (ulong)fs.Length, BlockSize = blockSize, StartBlock = currentBlock, Sequence = (ulong)i
|
||||
Size = (ulong)fs.Length,
|
||||
BlockSize = blockSize,
|
||||
StartBlock = currentBlock,
|
||||
Sequence = (ulong)i
|
||||
};
|
||||
|
||||
const uint SECTORS_TO_READ = 512;
|
||||
|
||||
@@ -310,7 +310,9 @@ namespace Aaru.Core
|
||||
|
||||
xattrTypes.Add(new ExtendedAttributeType
|
||||
{
|
||||
Checksums = xattrChkWorker.End().ToArray(), length = (ulong)data.Length, name = xattr
|
||||
Checksums = xattrChkWorker.End().ToArray(),
|
||||
length = (ulong)data.Length,
|
||||
name = xattr
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -57,9 +57,13 @@ namespace Aaru.Core
|
||||
{
|
||||
new LinearMediaType
|
||||
{
|
||||
Checksums = imgChecksums.ToArray(), Image = new ImageType
|
||||
Checksums = imgChecksums.ToArray(),
|
||||
Image = new ImageType
|
||||
{
|
||||
format = image.Format, offset = 0, offsetSpecified = true, Value = Path.GetFileName(imagePath)
|
||||
format = image.Format,
|
||||
offset = 0,
|
||||
offsetSpecified = true,
|
||||
Value = Path.GetFileName(imagePath)
|
||||
},
|
||||
Size = (ulong)fi.Length
|
||||
}
|
||||
|
||||
@@ -70,11 +70,16 @@ namespace Aaru.Core
|
||||
{
|
||||
new OpticalDiscType
|
||||
{
|
||||
Checksums = imgChecksums.ToArray(), Image = new ImageType
|
||||
Checksums = imgChecksums.ToArray(),
|
||||
Image = new ImageType
|
||||
{
|
||||
format = image.Format, offset = 0, offsetSpecified = true, Value = Path.GetFileName(imagePath)
|
||||
format = image.Format,
|
||||
offset = 0,
|
||||
offsetSpecified = true,
|
||||
Value = Path.GetFileName(imagePath)
|
||||
},
|
||||
Size = (ulong)fi.Length, Sequence = new SequenceType
|
||||
Size = (ulong)fi.Length,
|
||||
Sequence = new SequenceType
|
||||
{
|
||||
MediaTitle = image.Info.MediaTitle
|
||||
}
|
||||
@@ -182,7 +187,8 @@ namespace Aaru.Core
|
||||
|
||||
sidecar.OpticalDisc[0].Dimensions = new DimensionsType
|
||||
{
|
||||
Diameter = 120, Thickness = 1.2
|
||||
Diameter = 120,
|
||||
Thickness = 1.2
|
||||
};
|
||||
}
|
||||
else if(DMI.IsXbox360(image.ReadDiskTag(MediaTagType.DVD_DMI)))
|
||||
@@ -191,7 +197,8 @@ namespace Aaru.Core
|
||||
|
||||
sidecar.OpticalDisc[0].Dimensions = new DimensionsType
|
||||
{
|
||||
Diameter = 120, Thickness = 1.2
|
||||
Diameter = 120,
|
||||
Thickness = 1.2
|
||||
};
|
||||
}
|
||||
|
||||
@@ -366,7 +373,9 @@ namespace Aaru.Core
|
||||
{
|
||||
new XboxSecuritySectorsType
|
||||
{
|
||||
RequestNumber = 0, RequestVersion = 1, SecuritySectors = new DumpType
|
||||
RequestNumber = 0,
|
||||
RequestVersion = 1,
|
||||
SecuritySectors = new DumpType
|
||||
{
|
||||
Image = Path.GetFileName(imagePath),
|
||||
Checksums = Checksum.
|
||||
@@ -508,7 +517,8 @@ namespace Aaru.Core
|
||||
|
||||
xmlTrk.Sequence = new TrackSequenceType
|
||||
{
|
||||
Session = trk.TrackSession, TrackNumber = trk.TrackSequence
|
||||
Session = trk.TrackSession,
|
||||
TrackNumber = trk.TrackSequence
|
||||
};
|
||||
|
||||
xmlTrk.StartSector = trk.TrackStartSector;
|
||||
@@ -537,7 +547,8 @@ namespace Aaru.Core
|
||||
|
||||
xmlTrk.Image = new ImageType
|
||||
{
|
||||
Value = Path.GetFileName(trk.TrackFile), format = trk.TrackFileType
|
||||
Value = Path.GetFileName(trk.TrackFile),
|
||||
format = trk.TrackFileType
|
||||
};
|
||||
|
||||
if(trk.TrackFileOffset > 0)
|
||||
@@ -722,9 +733,12 @@ namespace Aaru.Core
|
||||
{
|
||||
xmlTrk.FileSystemInformation[i] = new PartitionType
|
||||
{
|
||||
Description = trkPartitions[i].Description, EndSector = trkPartitions[i].End,
|
||||
Name = trkPartitions[i].Name, Sequence = (uint)trkPartitions[i].Sequence,
|
||||
StartSector = trkPartitions[i].Start, Type = trkPartitions[i].Type
|
||||
Description = trkPartitions[i].Description,
|
||||
EndSector = trkPartitions[i].End,
|
||||
Name = trkPartitions[i].Name,
|
||||
Sequence = (uint)trkPartitions[i].Sequence,
|
||||
StartSector = trkPartitions[i].Start,
|
||||
Type = trkPartitions[i].Type
|
||||
};
|
||||
|
||||
List<FileSystemType> lstFs = new List<FileSystemType>();
|
||||
@@ -781,15 +795,19 @@ namespace Aaru.Core
|
||||
{
|
||||
xmlTrk.FileSystemInformation[0] = new PartitionType
|
||||
{
|
||||
EndSector = xmlTrk.EndSector, StartSector = xmlTrk.StartSector
|
||||
EndSector = xmlTrk.EndSector,
|
||||
StartSector = xmlTrk.StartSector
|
||||
};
|
||||
|
||||
List<FileSystemType> lstFs = new List<FileSystemType>();
|
||||
|
||||
var xmlPart = new Partition
|
||||
{
|
||||
Start = xmlTrk.StartSector, Length = (xmlTrk.EndSector - xmlTrk.StartSector) + 1,
|
||||
Type = xmlTrk.TrackType1.ToString(), Size = xmlTrk.Size, Sequence = xmlTrk.Sequence.TrackNumber
|
||||
Start = xmlTrk.StartSector,
|
||||
Length = (xmlTrk.EndSector - xmlTrk.StartSector) + 1,
|
||||
Type = xmlTrk.TrackType1.ToString(),
|
||||
Size = xmlTrk.Size,
|
||||
Sequence = xmlTrk.Sequence.TrackNumber
|
||||
};
|
||||
|
||||
foreach(IFilesystem plugin in plugins.PluginsList.Values)
|
||||
@@ -878,7 +896,8 @@ namespace Aaru.Core
|
||||
{
|
||||
xmlTrk.Indexes = trk.Indexes?.OrderBy(i => i.Key).Select(i => new TrackIndexType
|
||||
{
|
||||
index = i.Key, Value = i.Value
|
||||
index = i.Key,
|
||||
Value = i.Value
|
||||
}).ToArray();
|
||||
}
|
||||
|
||||
@@ -922,15 +941,19 @@ namespace Aaru.Core
|
||||
{
|
||||
new ExtentType
|
||||
{
|
||||
Start = 0, End = image.Info.Sectors
|
||||
Start = 0,
|
||||
End = image.Info.Sectors
|
||||
}
|
||||
},
|
||||
Manufacturer = image.Info.DriveManufacturer, Model = image.Info.DriveModel,
|
||||
Firmware = image.Info.DriveFirmwareRevision, Serial = image.Info.DriveSerialNumber, Software =
|
||||
new SoftwareType
|
||||
{
|
||||
Name = image.Info.Application, Version = image.Info.ApplicationVersion
|
||||
}
|
||||
Manufacturer = image.Info.DriveManufacturer,
|
||||
Model = image.Info.DriveModel,
|
||||
Firmware = image.Info.DriveFirmwareRevision,
|
||||
Serial = image.Info.DriveSerialNumber,
|
||||
Software = new SoftwareType
|
||||
{
|
||||
Name = image.Info.Application,
|
||||
Version = image.Info.ApplicationVersion
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -86,7 +86,8 @@ namespace Aaru.Core
|
||||
ctx.Commands.FirstOrDefault(c => c.Name == "analyze" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "analyze", Synchronized = true
|
||||
Name = "analyze",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.Analyze;
|
||||
@@ -99,7 +100,8 @@ namespace Aaru.Core
|
||||
ctx.Commands.FirstOrDefault(c => c.Name == "checksum" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "checksum", Synchronized = true
|
||||
Name = "checksum",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.Checksum;
|
||||
@@ -112,7 +114,8 @@ namespace Aaru.Core
|
||||
ctx.Commands.FirstOrDefault(c => c.Name == "compare" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "compare", Synchronized = true
|
||||
Name = "compare",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.Compare;
|
||||
@@ -125,7 +128,8 @@ namespace Aaru.Core
|
||||
ctx.Commands.FirstOrDefault(c => c.Name == "convert-image" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "convert-image", Synchronized = true
|
||||
Name = "convert-image",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.ConvertImage;
|
||||
@@ -138,7 +142,8 @@ namespace Aaru.Core
|
||||
ctx.Commands.FirstOrDefault(c => c.Name == "create-sidecar" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "create-sidecar", Synchronized = true
|
||||
Name = "create-sidecar",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.CreateSidecar;
|
||||
@@ -151,7 +156,8 @@ namespace Aaru.Core
|
||||
ctx.Commands.FirstOrDefault(c => c.Name == "decode" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "decode", Synchronized = true
|
||||
Name = "decode",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.Decode;
|
||||
@@ -164,7 +170,8 @@ namespace Aaru.Core
|
||||
ctx.Commands.FirstOrDefault(c => c.Name == "device-info" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "device-info", Synchronized = true
|
||||
Name = "device-info",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.DeviceInfo;
|
||||
@@ -177,7 +184,8 @@ namespace Aaru.Core
|
||||
ctx.Commands.FirstOrDefault(c => c.Name == "device-report" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "device-report", Synchronized = true
|
||||
Name = "device-report",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.DeviceReport;
|
||||
@@ -190,7 +198,8 @@ namespace Aaru.Core
|
||||
ctx.Commands.FirstOrDefault(c => c.Name == "dump-media" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "dump-media", Synchronized = true
|
||||
Name = "dump-media",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.DumpMedia;
|
||||
@@ -203,7 +212,8 @@ namespace Aaru.Core
|
||||
ctx.Commands.FirstOrDefault(c => c.Name == "entropy" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "entropy", Synchronized = true
|
||||
Name = "entropy",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.Entropy;
|
||||
@@ -216,7 +226,8 @@ namespace Aaru.Core
|
||||
ctx.Commands.FirstOrDefault(c => c.Name == "extract-files" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "extract-files", Synchronized = true
|
||||
Name = "extract-files",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.ExtractFiles;
|
||||
@@ -229,7 +240,8 @@ namespace Aaru.Core
|
||||
ctx.Commands.FirstOrDefault(c => c.Name == "formats" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "formats", Synchronized = true
|
||||
Name = "formats",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.Formats;
|
||||
@@ -242,7 +254,8 @@ namespace Aaru.Core
|
||||
ctx.Commands.FirstOrDefault(c => c.Name == "image-info" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "image-info", Synchronized = true
|
||||
Name = "image-info",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.ImageInfo;
|
||||
@@ -255,7 +268,8 @@ namespace Aaru.Core
|
||||
ctx.Commands.FirstOrDefault(c => c.Name == "list-devices" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "list-devices", Synchronized = true
|
||||
Name = "list-devices",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.ListDevices;
|
||||
@@ -268,7 +282,8 @@ namespace Aaru.Core
|
||||
ctx.Commands.FirstOrDefault(c => c.Name == "list-encodings" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "list-encodings", Synchronized = true
|
||||
Name = "list-encodings",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.ListEncodings;
|
||||
@@ -280,7 +295,8 @@ namespace Aaru.Core
|
||||
Command command = ctx.Commands.FirstOrDefault(c => c.Name == "ls" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "ls", Synchronized = true
|
||||
Name = "ls",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.Ls;
|
||||
@@ -293,7 +309,8 @@ namespace Aaru.Core
|
||||
ctx.Commands.FirstOrDefault(c => c.Name == "media-info" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "media-info", Synchronized = true
|
||||
Name = "media-info",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.MediaInfo;
|
||||
@@ -306,7 +323,8 @@ namespace Aaru.Core
|
||||
ctx.Commands.FirstOrDefault(c => c.Name == "media-scan" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "media-scan", Synchronized = true
|
||||
Name = "media-scan",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.MediaScan;
|
||||
@@ -319,7 +337,8 @@ namespace Aaru.Core
|
||||
ctx.Commands.FirstOrDefault(c => c.Name == "printhex" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "printhex", Synchronized = true
|
||||
Name = "printhex",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.PrintHex;
|
||||
@@ -332,7 +351,8 @@ namespace Aaru.Core
|
||||
ctx.Commands.FirstOrDefault(c => c.Name == "verify" && c.Synchronized) ??
|
||||
new Command
|
||||
{
|
||||
Name = "verify", Synchronized = true
|
||||
Name = "verify",
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
command.Count += (ulong)allStats.Commands.Verify;
|
||||
@@ -352,7 +372,8 @@ namespace Aaru.Core
|
||||
c.Version == operatingSystem.version &&
|
||||
c.Synchronized) ?? new OperatingSystem
|
||||
{
|
||||
Name = operatingSystem.name, Version = operatingSystem.version,
|
||||
Name = operatingSystem.name,
|
||||
Version = operatingSystem.version,
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
@@ -370,7 +391,8 @@ namespace Aaru.Core
|
||||
ctx.Versions.FirstOrDefault(c => c.Name == nvs.name && c.Synchronized) ??
|
||||
new Version
|
||||
{
|
||||
Name = nvs.name, Synchronized = true
|
||||
Name = nvs.name,
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
existing.Count += (ulong)nvs.Value;
|
||||
@@ -387,7 +409,8 @@ namespace Aaru.Core
|
||||
ctx.Filesystems.FirstOrDefault(c => c.Name == nvs.name && c.Synchronized) ??
|
||||
new Filesystem
|
||||
{
|
||||
Name = nvs.name, Synchronized = true
|
||||
Name = nvs.name,
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
existing.Count += (ulong)nvs.Value;
|
||||
@@ -404,7 +427,8 @@ namespace Aaru.Core
|
||||
ctx.Partitions.FirstOrDefault(c => c.Name == nvs.name && c.Synchronized) ??
|
||||
new Partition
|
||||
{
|
||||
Name = nvs.name, Synchronized = true
|
||||
Name = nvs.name,
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
existing.Count += (ulong)nvs.Value;
|
||||
@@ -421,7 +445,8 @@ namespace Aaru.Core
|
||||
ctx.Filesystems.FirstOrDefault(c => c.Name == nvs.name && c.Synchronized) ??
|
||||
new Filesystem
|
||||
{
|
||||
Name = nvs.name, Synchronized = true
|
||||
Name = nvs.name,
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
existing.Count += (ulong)nvs.Value;
|
||||
@@ -438,7 +463,8 @@ namespace Aaru.Core
|
||||
ctx.MediaFormats.FirstOrDefault(c => c.Name == nvs.name && c.Synchronized) ??
|
||||
new MediaFormat
|
||||
{
|
||||
Name = nvs.name, Synchronized = true
|
||||
Name = nvs.name,
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
existing.Count += (ulong)nvs.Value;
|
||||
@@ -454,7 +480,8 @@ namespace Aaru.Core
|
||||
Filter existing =
|
||||
ctx.Filters.FirstOrDefault(c => c.Name == nvs.name && c.Synchronized) ?? new Filter
|
||||
{
|
||||
Name = nvs.name, Synchronized = true
|
||||
Name = nvs.name,
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
existing.Count += (ulong)nvs.Value;
|
||||
@@ -471,8 +498,11 @@ namespace Aaru.Core
|
||||
|
||||
ctx.SeenDevices.Add(new DeviceStat
|
||||
{
|
||||
Bus = device.Bus, Manufacturer = device.Manufacturer, Model = device.Model,
|
||||
Revision = device.Revision, Synchronized = true
|
||||
Bus = device.Bus,
|
||||
Manufacturer = device.Manufacturer,
|
||||
Model = device.Model,
|
||||
Revision = device.Revision,
|
||||
Synchronized = true
|
||||
});
|
||||
}
|
||||
|
||||
@@ -486,7 +516,9 @@ namespace Aaru.Core
|
||||
ctx.Medias.FirstOrDefault(c => c.Type == media.type && c.Real == media.real &&
|
||||
c.Synchronized) ?? new Database.Models.Media
|
||||
{
|
||||
Type = media.type, Real = media.real, Synchronized = true
|
||||
Type = media.type,
|
||||
Real = media.real,
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
existing.Count += (ulong)media.Value;
|
||||
@@ -506,13 +538,17 @@ namespace Aaru.Core
|
||||
|
||||
ctx.OperatingSystems.Add(new OperatingSystem
|
||||
{
|
||||
Name = DetectOS.GetRealPlatformID().ToString(), Synchronized = false,
|
||||
Version = DetectOS.GetVersion(), Count = 1
|
||||
Name = DetectOS.GetRealPlatformID().ToString(),
|
||||
Synchronized = false,
|
||||
Version = DetectOS.GetVersion(),
|
||||
Count = 1
|
||||
});
|
||||
|
||||
ctx.Versions.Add(new Version
|
||||
{
|
||||
Name = CommonTypes.Interop.Version.GetVersion(), Synchronized = false, Count = 1
|
||||
Name = CommonTypes.Interop.Version.GetVersion(),
|
||||
Synchronized = false,
|
||||
Count = 1
|
||||
});
|
||||
|
||||
ctx.SaveChanges();
|
||||
@@ -581,7 +617,8 @@ namespace Aaru.Core
|
||||
Distinct())
|
||||
dto.Commands.Add(new NameValueStats
|
||||
{
|
||||
name = nvs, Value = ctx.Commands.LongCount(c => !c.Synchronized && c.Name == nvs)
|
||||
name = nvs,
|
||||
Value = ctx.Commands.LongCount(c => !c.Synchronized && c.Name == nvs)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -593,7 +630,8 @@ namespace Aaru.Core
|
||||
Distinct())
|
||||
dto.Filesystems.Add(new NameValueStats
|
||||
{
|
||||
name = nvs, Value = ctx.Filesystems.LongCount(c => !c.Synchronized && c.Name == nvs)
|
||||
name = nvs,
|
||||
Value = ctx.Filesystems.LongCount(c => !c.Synchronized && c.Name == nvs)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -605,7 +643,8 @@ namespace Aaru.Core
|
||||
)
|
||||
dto.Filters.Add(new NameValueStats
|
||||
{
|
||||
name = nvs, Value = ctx.Filters.LongCount(c => !c.Synchronized && c.Name == nvs)
|
||||
name = nvs,
|
||||
Value = ctx.Filters.LongCount(c => !c.Synchronized && c.Name == nvs)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -630,7 +669,8 @@ namespace Aaru.Core
|
||||
Distinct())
|
||||
dto.Partitions.Add(new NameValueStats
|
||||
{
|
||||
name = nvs, Value = ctx.Partitions.LongCount(c => !c.Synchronized && c.Name == nvs)
|
||||
name = nvs,
|
||||
Value = ctx.Partitions.LongCount(c => !c.Synchronized && c.Name == nvs)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -642,7 +682,8 @@ namespace Aaru.Core
|
||||
Distinct())
|
||||
dto.Versions.Add(new NameValueStats
|
||||
{
|
||||
name = nvs, Value = ctx.Versions.LongCount(c => !c.Synchronized && c.Name == nvs)
|
||||
name = nvs,
|
||||
Value = ctx.Versions.LongCount(c => !c.Synchronized && c.Name == nvs)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -656,14 +697,16 @@ namespace Aaru.Core
|
||||
if(ctx.Medias.Any(c => !c.Synchronized && c.Type == media && c.Real))
|
||||
dto.Medias.Add(new MediaStats
|
||||
{
|
||||
real = true, type = media,
|
||||
real = true,
|
||||
type = media,
|
||||
Value = ctx.Medias.LongCount(c => !c.Synchronized && c.Type == media && c.Real)
|
||||
});
|
||||
|
||||
if(ctx.Medias.Any(c => !c.Synchronized && c.Type == media && !c.Real))
|
||||
dto.Medias.Add(new MediaStats
|
||||
{
|
||||
real = false, type = media,
|
||||
real = false,
|
||||
type = media,
|
||||
Value = ctx.Medias.LongCount(c => !c.Synchronized && c.Type == media && !c.Real)
|
||||
});
|
||||
}
|
||||
@@ -676,8 +719,10 @@ namespace Aaru.Core
|
||||
foreach(DeviceStat device in ctx.SeenDevices.Where(c => !c.Synchronized))
|
||||
dto.Devices.Add(new DeviceStats
|
||||
{
|
||||
Bus = device.Bus, Manufacturer = device.Manufacturer,
|
||||
ManufacturerSpecified = !(device.Manufacturer is null), Model = device.Model,
|
||||
Bus = device.Bus,
|
||||
Manufacturer = device.Manufacturer,
|
||||
ManufacturerSpecified = !(device.Manufacturer is null),
|
||||
Model = device.Model,
|
||||
Revision = device.Revision
|
||||
});
|
||||
}
|
||||
@@ -696,7 +741,8 @@ namespace Aaru.Core
|
||||
Select(c => c.Version).Distinct())
|
||||
dto.OperatingSystems.Add(new OsStats
|
||||
{
|
||||
name = osName, version = osVersion,
|
||||
name = osName,
|
||||
version = osVersion,
|
||||
Value = ctx.OperatingSystems.LongCount(c => !c.Synchronized &&
|
||||
c.Name == osName &&
|
||||
c.Version == osVersion)
|
||||
@@ -719,7 +765,8 @@ namespace Aaru.Core
|
||||
Select(c => c.Version).Distinct())
|
||||
dto.RemoteApplications.Add(new OsStats
|
||||
{
|
||||
name = remoteAppName, version = remoteAppVersion,
|
||||
name = remoteAppName,
|
||||
version = remoteAppVersion,
|
||||
Value = ctx.RemoteApplications.LongCount(c => !c.Synchronized &&
|
||||
c.Name == remoteAppName &&
|
||||
c.Version == remoteAppVersion)
|
||||
@@ -754,7 +801,8 @@ namespace Aaru.Core
|
||||
Select(c => c.Version).Distinct())
|
||||
dto.RemoteOperatingSystems.Add(new OsStats
|
||||
{
|
||||
name = remoteOsName, version = remoteOsVersion,
|
||||
name = remoteOsName,
|
||||
version = remoteOsVersion,
|
||||
Value = ctx.RemoteOperatingSystems.LongCount(c => !c.Synchronized &&
|
||||
c.Name == remoteOsName &&
|
||||
c.Version == remoteOsVersion)
|
||||
@@ -808,7 +856,8 @@ namespace Aaru.Core
|
||||
Command existing = ctx.Commands.FirstOrDefault(c => c.Synchronized && c.Name == nvs) ??
|
||||
new Command
|
||||
{
|
||||
Name = nvs, Synchronized = true
|
||||
Name = nvs,
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
existing.Count += (ulong)ctx.Commands.LongCount(c => !c.Synchronized && c.Name == nvs);
|
||||
@@ -824,7 +873,8 @@ namespace Aaru.Core
|
||||
ctx.Filesystems.FirstOrDefault(c => c.Synchronized && c.Name == nvs) ??
|
||||
new Filesystem
|
||||
{
|
||||
Name = nvs, Synchronized = true
|
||||
Name = nvs,
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
existing.Count +=
|
||||
@@ -843,7 +893,8 @@ namespace Aaru.Core
|
||||
Filter existing = ctx.Filters.FirstOrDefault(c => c.Synchronized && c.Name == nvs) ??
|
||||
new Filter
|
||||
{
|
||||
Name = nvs, Synchronized = true
|
||||
Name = nvs,
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
existing.Count += (ulong)ctx.Filters.LongCount(c => !c.Synchronized && c.Name == nvs);
|
||||
@@ -859,7 +910,8 @@ namespace Aaru.Core
|
||||
ctx.MediaFormats.FirstOrDefault(c => c.Synchronized && c.Name == nvs) ??
|
||||
new MediaFormat
|
||||
{
|
||||
Name = nvs, Synchronized = true
|
||||
Name = nvs,
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
existing.Count +=
|
||||
@@ -878,7 +930,8 @@ namespace Aaru.Core
|
||||
Partition existing =
|
||||
ctx.Partitions.FirstOrDefault(c => c.Synchronized && c.Name == nvs) ?? new Partition
|
||||
{
|
||||
Name = nvs, Synchronized = true
|
||||
Name = nvs,
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
existing.Count +=
|
||||
@@ -895,7 +948,8 @@ namespace Aaru.Core
|
||||
Version existing = ctx.Versions.FirstOrDefault(c => c.Synchronized && c.Name == nvs) ??
|
||||
new Version
|
||||
{
|
||||
Name = nvs, Synchronized = true
|
||||
Name = nvs,
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
existing.Count += (ulong)ctx.Versions.LongCount(c => !c.Synchronized && c.Name == nvs);
|
||||
@@ -913,7 +967,9 @@ namespace Aaru.Core
|
||||
ctx.Medias.FirstOrDefault(c => c.Synchronized && c.Type == media && c.Real) ??
|
||||
new Database.Models.Media
|
||||
{
|
||||
Synchronized = true, Type = media, Real = true
|
||||
Synchronized = true,
|
||||
Type = media,
|
||||
Real = true
|
||||
};
|
||||
|
||||
existing.Count +=
|
||||
@@ -933,7 +989,9 @@ namespace Aaru.Core
|
||||
ctx.Medias.FirstOrDefault(c => c.Synchronized && c.Type == media && !c.Real) ??
|
||||
new Database.Models.Media
|
||||
{
|
||||
Synchronized = true, Type = media, Real = false
|
||||
Synchronized = true,
|
||||
Type = media,
|
||||
Real = false
|
||||
};
|
||||
|
||||
existing.Count +=
|
||||
@@ -968,7 +1026,9 @@ namespace Aaru.Core
|
||||
c.Version == osVersion) ??
|
||||
new OperatingSystem
|
||||
{
|
||||
Synchronized = true, Version = osVersion, Name = osName
|
||||
Synchronized = true,
|
||||
Version = osVersion,
|
||||
Name = osName
|
||||
};
|
||||
|
||||
existing.Count +=
|
||||
@@ -1002,7 +1062,9 @@ namespace Aaru.Core
|
||||
c.Version == remoteAppVersion) ??
|
||||
new RemoteApplication
|
||||
{
|
||||
Synchronized = true, Version = remoteAppVersion, Name = remoteAppName
|
||||
Synchronized = true,
|
||||
Version = remoteAppVersion,
|
||||
Name = remoteAppName
|
||||
};
|
||||
|
||||
existing.Count +=
|
||||
@@ -1030,7 +1092,8 @@ namespace Aaru.Core
|
||||
ctx.RemoteArchitectures.FirstOrDefault(c => c.Synchronized && c.Name == nvs) ??
|
||||
new RemoteArchitecture
|
||||
{
|
||||
Name = nvs, Synchronized = true
|
||||
Name = nvs,
|
||||
Synchronized = true
|
||||
};
|
||||
|
||||
existing.Count +=
|
||||
@@ -1057,7 +1120,9 @@ namespace Aaru.Core
|
||||
c.Version == remoteOsVersion) ??
|
||||
new RemoteOperatingSystem
|
||||
{
|
||||
Synchronized = true, Version = remoteOsVersion, Name = remoteOsName
|
||||
Synchronized = true,
|
||||
Version = remoteOsVersion,
|
||||
Name = remoteOsName
|
||||
};
|
||||
|
||||
existing.Count +=
|
||||
@@ -1189,7 +1254,9 @@ namespace Aaru.Core
|
||||
|
||||
ctx.Commands.Add(new Command
|
||||
{
|
||||
Name = command, Synchronized = false, Count = 1
|
||||
Name = command,
|
||||
Synchronized = false,
|
||||
Count = 1
|
||||
});
|
||||
|
||||
try
|
||||
@@ -1218,7 +1285,9 @@ namespace Aaru.Core
|
||||
|
||||
ctx.Filesystems.Add(new Filesystem
|
||||
{
|
||||
Name = filesystem, Synchronized = false, Count = 1
|
||||
Name = filesystem,
|
||||
Synchronized = false,
|
||||
Count = 1
|
||||
});
|
||||
|
||||
try
|
||||
@@ -1247,7 +1316,9 @@ namespace Aaru.Core
|
||||
|
||||
ctx.Partitions.Add(new Partition
|
||||
{
|
||||
Name = partition, Synchronized = false, Count = 1
|
||||
Name = partition,
|
||||
Synchronized = false,
|
||||
Count = 1
|
||||
});
|
||||
|
||||
try
|
||||
@@ -1276,7 +1347,9 @@ namespace Aaru.Core
|
||||
|
||||
ctx.Filters.Add(new Filter
|
||||
{
|
||||
Name = filter, Synchronized = false, Count = 1
|
||||
Name = filter,
|
||||
Synchronized = false,
|
||||
Count = 1
|
||||
});
|
||||
|
||||
try
|
||||
@@ -1305,7 +1378,9 @@ namespace Aaru.Core
|
||||
|
||||
ctx.MediaFormats.Add(new MediaFormat
|
||||
{
|
||||
Name = format, Synchronized = false, Count = 1
|
||||
Name = format,
|
||||
Synchronized = false,
|
||||
Count = 1
|
||||
});
|
||||
|
||||
try
|
||||
@@ -1344,7 +1419,10 @@ namespace Aaru.Core
|
||||
|
||||
ctx.SeenDevices.Add(new DeviceStat
|
||||
{
|
||||
Bus = deviceBus, Manufacturer = dev.Manufacturer, Model = dev.Model, Revision = dev.FirmwareRevision,
|
||||
Bus = deviceBus,
|
||||
Manufacturer = dev.Manufacturer,
|
||||
Model = dev.Model,
|
||||
Revision = dev.FirmwareRevision,
|
||||
Synchronized = false
|
||||
});
|
||||
|
||||
@@ -1372,7 +1450,10 @@ namespace Aaru.Core
|
||||
|
||||
ctx.Medias.Add(new Database.Models.Media
|
||||
{
|
||||
Real = real, Synchronized = false, Type = type.ToString(), Count = 1
|
||||
Real = real,
|
||||
Synchronized = false,
|
||||
Type = type.ToString(),
|
||||
Count = 1
|
||||
});
|
||||
|
||||
try
|
||||
@@ -1398,17 +1479,25 @@ namespace Aaru.Core
|
||||
|
||||
ctx.RemoteApplications.Add(new RemoteApplication
|
||||
{
|
||||
Count = 1, Name = serverApplication, Synchronized = false, Version = serverVersion
|
||||
Count = 1,
|
||||
Name = serverApplication,
|
||||
Synchronized = false,
|
||||
Version = serverVersion
|
||||
});
|
||||
|
||||
ctx.RemoteArchitectures.Add(new RemoteArchitecture
|
||||
{
|
||||
Count = 1, Name = serverArchitecture, Synchronized = false
|
||||
Count = 1,
|
||||
Name = serverArchitecture,
|
||||
Synchronized = false
|
||||
});
|
||||
|
||||
ctx.RemoteOperatingSystems.Add(new RemoteOperatingSystem
|
||||
{
|
||||
Count = 1, Name = serverOperatingSystem, Synchronized = false, Version = serverOperatingSystemVersion
|
||||
Count = 1,
|
||||
Name = serverOperatingSystem,
|
||||
Synchronized = false,
|
||||
Version = serverOperatingSystemVersion
|
||||
});
|
||||
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user