mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Added specific console handling for standard, verbose, debug
and error outputs.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2015-10-18 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* DiscImageChef.sln:
|
||||
Added specific console handling for standard, verbose, debug
|
||||
and error outputs.
|
||||
|
||||
2015-10-12 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* DiscImageChef.sln:
|
||||
|
||||
@@ -37,6 +37,7 @@ ECC algorithm from ECM (C) 2002-2011 Neill Corlett
|
||||
****************************************************************************/
|
||||
//$Id$
|
||||
using System;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.Checksums
|
||||
{
|
||||
@@ -163,19 +164,16 @@ namespace DiscImageChef.Checksums
|
||||
channel[0x00A] == 0xFF &&
|
||||
channel[0x00B] == 0x00)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): Data sector, address {0:X2}:{1:X2}:{2:X2}", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Data sector, address {0:X2}:{1:X2}:{2:X2}", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
|
||||
if (channel[0x00F] == 0x00) // mode (1 byte)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): Mode 0 sector at address {0:X2}:{1:X2}:{2:X2}", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Mode 0 sector at address {0:X2}:{1:X2}:{2:X2}", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
for (int i = 0x010; i < 0x930; i++)
|
||||
{
|
||||
if (channel[i] != 0x00)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): Mode 0 sector with error at address: {0:X2}:{1:X2}:{2:X2}", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Mode 0 sector with error at address: {0:X2}:{1:X2}:{2:X2}", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -183,8 +181,7 @@ namespace DiscImageChef.Checksums
|
||||
}
|
||||
else if (channel[0x00F] == 0x01) // mode (1 byte)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): Mode 1 sector at address {0:X2}:{1:X2}:{2:X2}", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Mode 1 sector at address {0:X2}:{1:X2}:{2:X2}", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
|
||||
if (channel[0x814] != 0x00 || // reserved (8 bytes)
|
||||
channel[0x815] != 0x00 ||
|
||||
@@ -195,8 +192,7 @@ namespace DiscImageChef.Checksums
|
||||
channel[0x81A] != 0x00 ||
|
||||
channel[0x81B] != 0x00)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): Mode 1 sector with data in reserved bytes at address: {0:X2}:{1:X2}:{2:X2}", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Mode 1 sector with data in reserved bytes at address: {0:X2}:{1:X2}:{2:X2}", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -216,11 +212,9 @@ namespace DiscImageChef.Checksums
|
||||
bool FailedECC_Q = CheckECC(address, data2, 52, 43, 86, 88, ecc_q);
|
||||
|
||||
if (FailedECC_P)
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): Mode 1 sector at address: {0:X2}:{1:X2}:{2:X2}, fails ECC P check", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Mode 1 sector at address: {0:X2}:{1:X2}:{2:X2}, fails ECC P check", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
if (FailedECC_Q)
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): Mode 1 sector at address: {0:X2}:{1:X2}:{2:X2}, fails ECC Q check", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Mode 1 sector at address: {0:X2}:{1:X2}:{2:X2}, fails ECC Q check", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
|
||||
if (FailedECC_P || FailedECC_Q)
|
||||
return false;
|
||||
@@ -234,8 +228,7 @@ namespace DiscImageChef.Checksums
|
||||
|
||||
if (CalculatedEDC != StoredEDC)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): Mode 1 sector at address: {0:X2}:{1:X2}:{2:X2}, got CRC 0x{3:X8} expected 0x{4:X8}", channel[0x00C], channel[0x00D], channel[0x00E], CalculatedEDC, StoredEDC);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Mode 1 sector at address: {0:X2}:{1:X2}:{2:X2}, got CRC 0x{3:X8} expected 0x{4:X8}", channel[0x00C], channel[0x00D], channel[0x00E], CalculatedEDC, StoredEDC);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -243,15 +236,13 @@ namespace DiscImageChef.Checksums
|
||||
}
|
||||
else if (channel[0x00F] == 0x02) // mode (1 byte)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): Mode 2 sector at address {0:X2}:{1:X2}:{2:X2}", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Mode 2 sector at address {0:X2}:{1:X2}:{2:X2}", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
|
||||
if ((channel[0x012] & 0x20) == 0x20) // mode 2 form 2
|
||||
{
|
||||
if (channel[0x010] != channel[0x014] || channel[0x011] != channel[0x015] || channel[0x012] != channel[0x016] || channel[0x013] != channel[0x017])
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): Subheader copies differ in mode 2 form 2 sector at address: {0:X2}:{1:X2}:{2:X2}", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Subheader copies differ in mode 2 form 2 sector at address: {0:X2}:{1:X2}:{2:X2}", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
}
|
||||
|
||||
byte[] SectorForCheck = new byte[0x91C];
|
||||
@@ -263,8 +254,7 @@ namespace DiscImageChef.Checksums
|
||||
|
||||
if (CalculatedEDC != StoredEDC && StoredEDC != 0x00000000)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): Mode 2 form 2 sector at address: {0:X2}:{1:X2}:{2:X2}, got CRC 0x{3:X8} expected 0x{4:X8}", channel[0x00C], channel[0x00D], channel[0x00E], CalculatedEDC, StoredEDC);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Mode 2 form 2 sector at address: {0:X2}:{1:X2}:{2:X2}, got CRC 0x{3:X8} expected 0x{4:X8}", channel[0x00C], channel[0x00D], channel[0x00E], CalculatedEDC, StoredEDC);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -272,8 +262,7 @@ namespace DiscImageChef.Checksums
|
||||
{
|
||||
if (channel[0x010] != channel[0x014] || channel[0x011] != channel[0x015] || channel[0x012] != channel[0x016] || channel[0x013] != channel[0x017])
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): Subheader copies differ in mode 2 form 1 sector at address: {0:X2}:{1:X2}:{2:X2}", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Subheader copies differ in mode 2 form 1 sector at address: {0:X2}:{1:X2}:{2:X2}", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
}
|
||||
|
||||
byte[] address = new byte[4];
|
||||
@@ -295,11 +284,9 @@ namespace DiscImageChef.Checksums
|
||||
bool FailedECC_Q = CheckECC(address, data2, 52, 43, 86, 88, ecc_q);
|
||||
|
||||
if (FailedECC_P)
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): Mode 2 form 1 sector at address: {0:X2}:{1:X2}:{2:X2}, fails ECC P check", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Mode 2 form 1 sector at address: {0:X2}:{1:X2}:{2:X2}, fails ECC P check", channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
if (FailedECC_Q)
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): Mode 2 form 1 sector at address: {0:X2}:{1:X2}:{2:X2}, fails ECC Q check", channel[0x00F], channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Mode 2 form 1 sector at address: {0:X2}:{1:X2}:{2:X2}, fails ECC Q check", channel[0x00F], channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
|
||||
if (FailedECC_P || FailedECC_Q)
|
||||
return false;
|
||||
@@ -313,8 +300,7 @@ namespace DiscImageChef.Checksums
|
||||
|
||||
if (CalculatedEDC != StoredEDC)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): Mode 2 form 1 sector at address: {0:X2}:{1:X2}:{2:X2}, got CRC 0x{3:X8} expected 0x{4:X8}", channel[0x00C], channel[0x00D], channel[0x00E], CalculatedEDC, StoredEDC);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Mode 2 form 1 sector at address: {0:X2}:{1:X2}:{2:X2}, got CRC 0x{3:X8} expected 0x{4:X8}", channel[0x00C], channel[0x00D], channel[0x00E], CalculatedEDC, StoredEDC);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -323,8 +309,7 @@ namespace DiscImageChef.Checksums
|
||||
}
|
||||
else
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): Unknown mode {0} sector at address: {1:X2}:{2:X2}:{3:X2}", channel[0x00F], channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Unknown mode {0} sector at address: {1:X2}:{2:X2}:{3:X2}", channel[0x00F], channel[0x00C], channel[0x00D], channel[0x00E]);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -454,36 +439,33 @@ namespace DiscImageChef.Checksums
|
||||
CDSubRWPack4[j] = (byte)(subchannel[i++] & 0x3F);
|
||||
}
|
||||
|
||||
//if(MainClass.isDebug)
|
||||
//{
|
||||
switch(CDSubRWPack1[0])
|
||||
switch (CDSubRWPack1[0])
|
||||
{
|
||||
case 0x00:
|
||||
Console.WriteLine("Detected Zero Pack in subchannel");
|
||||
DicConsole.DebugWriteLine("CD checksums", "Detected Zero Pack in subchannel");
|
||||
break;
|
||||
case 0x08:
|
||||
Console.WriteLine("Detected Line Graphics Pack in subchannel");
|
||||
DicConsole.DebugWriteLine("CD checksums", "Detected Line Graphics Pack in subchannel");
|
||||
break;
|
||||
case 0x09:
|
||||
Console.WriteLine("Detected CD+G Pack in subchannel");
|
||||
DicConsole.DebugWriteLine("CD checksums", "Detected CD+G Pack in subchannel");
|
||||
break;
|
||||
case 0x0A:
|
||||
Console.WriteLine("Detected CD+EG Pack in subchannel");
|
||||
DicConsole.DebugWriteLine("CD checksums", "Detected CD+EG Pack in subchannel");
|
||||
break;
|
||||
case 0x14:
|
||||
Console.WriteLine("Detected CD-TEXT Pack in subchannel");
|
||||
DicConsole.DebugWriteLine("CD checksums", "Detected CD-TEXT Pack in subchannel");
|
||||
break;
|
||||
case 0x18:
|
||||
Console.WriteLine("Detected CD+MIDI Pack in subchannel");
|
||||
DicConsole.DebugWriteLine("CD checksums", "Detected CD+MIDI Pack in subchannel");
|
||||
break;
|
||||
case 0x38:
|
||||
Console.WriteLine("Detected User Pack in subchannel");
|
||||
DicConsole.DebugWriteLine("CD checksums", "Detected User Pack in subchannel");
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("Detected unknown Pack type in subchannel: mode {0}, item {1}", Convert.ToString(CDSubRWPack1[0] & 0x38, 2), Convert.ToString(CDSubRWPack1[0] & 0x07, 2));
|
||||
DicConsole.DebugWriteLine("CD checksums", "Detected unknown Pack type in subchannel: mode {0}, item {1}", Convert.ToString(CDSubRWPack1[0] & 0x38, 2), Convert.ToString(CDSubRWPack1[0] & 0x07, 2));
|
||||
break;
|
||||
}
|
||||
//}
|
||||
|
||||
BigEndianBitConverter.IsLittleEndian = true;
|
||||
|
||||
@@ -494,8 +476,7 @@ namespace DiscImageChef.Checksums
|
||||
|
||||
if (QSubChannelCRC != CalculatedQCRC)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): Q subchannel CRC 0x{0:X4}, expected 0x{1:X4}", CalculatedQCRC, QSubChannelCRC);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Q subchannel CRC 0x{0:X4}, expected 0x{1:X4}", CalculatedQCRC, QSubChannelCRC);
|
||||
status = false;
|
||||
}
|
||||
|
||||
@@ -508,8 +489,7 @@ namespace DiscImageChef.Checksums
|
||||
|
||||
if (CDTextPack1CRC != CalculatedCDTP1CRC && CDTextPack1CRC != 0)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): CD-Text Pack 1 CRC 0x{0:X4}, expected 0x{1:X4}", CDTextPack1CRC, CalculatedCDTP1CRC);
|
||||
DicConsole.DebugWriteLine("CD checksums", "CD-Text Pack 1 CRC 0x{0:X4}, expected 0x{1:X4}", CDTextPack1CRC, CalculatedCDTP1CRC);
|
||||
status = false;
|
||||
}
|
||||
}
|
||||
@@ -520,12 +500,11 @@ namespace DiscImageChef.Checksums
|
||||
byte[] CDTextPack2ForCRC = new byte[16];
|
||||
Array.Copy(CDTextPack2, 0, CDTextPack2ForCRC, 0, 16);
|
||||
UInt16 CalculatedCDTP2CRC = CalculateCCITT_CRC16(CDTextPack2ForCRC);
|
||||
Console.WriteLine("Cyclic CDTP2 0x{0:X4}, Calc CDTP2 0x{1:X4}", CDTextPack2CRC, CalculatedCDTP2CRC);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Cyclic CDTP2 0x{0:X4}, Calc CDTP2 0x{1:X4}", CDTextPack2CRC, CalculatedCDTP2CRC);
|
||||
|
||||
if (CDTextPack2CRC != CalculatedCDTP2CRC && CDTextPack2CRC != 0)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): CD-Text Pack 2 CRC 0x{0:X4}, expected 0x{1:X4}", CDTextPack2CRC, CalculatedCDTP2CRC);
|
||||
DicConsole.DebugWriteLine("CD checksums", "CD-Text Pack 2 CRC 0x{0:X4}, expected 0x{1:X4}", CDTextPack2CRC, CalculatedCDTP2CRC);
|
||||
status = false;
|
||||
}
|
||||
}
|
||||
@@ -536,12 +515,11 @@ namespace DiscImageChef.Checksums
|
||||
byte[] CDTextPack3ForCRC = new byte[16];
|
||||
Array.Copy(CDTextPack3, 0, CDTextPack3ForCRC, 0, 16);
|
||||
UInt16 CalculatedCDTP3CRC = CalculateCCITT_CRC16(CDTextPack3ForCRC);
|
||||
Console.WriteLine("Cyclic CDTP3 0x{0:X4}, Calc CDTP3 0x{1:X4}", CDTextPack3CRC, CalculatedCDTP3CRC);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Cyclic CDTP3 0x{0:X4}, Calc CDTP3 0x{1:X4}", CDTextPack3CRC, CalculatedCDTP3CRC);
|
||||
|
||||
if (CDTextPack3CRC != CalculatedCDTP3CRC && CDTextPack3CRC != 0)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): CD-Text Pack 3 CRC 0x{0:X4}, expected 0x{1:X4}", CDTextPack3CRC, CalculatedCDTP3CRC);
|
||||
DicConsole.DebugWriteLine("CD checksums", "CD-Text Pack 3 CRC 0x{0:X4}, expected 0x{1:X4}", CDTextPack3CRC, CalculatedCDTP3CRC);
|
||||
status = false;
|
||||
}
|
||||
}
|
||||
@@ -552,12 +530,11 @@ namespace DiscImageChef.Checksums
|
||||
byte[] CDTextPack4ForCRC = new byte[16];
|
||||
Array.Copy(CDTextPack4, 0, CDTextPack4ForCRC, 0, 16);
|
||||
UInt16 CalculatedCDTP4CRC = CalculateCCITT_CRC16(CDTextPack4ForCRC);
|
||||
Console.WriteLine("Cyclic CDTP4 0x{0:X4}, Calc CDTP4 0x{1:X4}", CDTextPack4CRC, CalculatedCDTP4CRC);
|
||||
DicConsole.DebugWriteLine("CD checksums", "Cyclic CDTP4 0x{0:X4}, Calc CDTP4 0x{1:X4}", CDTextPack4CRC, CalculatedCDTP4CRC);
|
||||
|
||||
if (CDTextPack4CRC != CalculatedCDTP4CRC && CDTextPack4CRC != 0)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDChecksums): CD-Text Pack 4 CRC 0x{0:X4}, expected 0x{1:X4}", CDTextPack4CRC, CalculatedCDTP4CRC);
|
||||
DicConsole.DebugWriteLine("CD checksums", "CD-Text Pack 4 CRC 0x{0:X4}, expected 0x{1:X4}", CDTextPack4CRC, CalculatedCDTP4CRC);
|
||||
status = false;
|
||||
}
|
||||
}
|
||||
@@ -565,7 +542,8 @@ namespace DiscImageChef.Checksums
|
||||
return status;
|
||||
}
|
||||
|
||||
static readonly ushort[] CCITT_CRC16Table = {
|
||||
static readonly ushort[] CCITT_CRC16Table =
|
||||
{
|
||||
0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7,
|
||||
0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef,
|
||||
0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
|
||||
@@ -602,8 +580,9 @@ namespace DiscImageChef.Checksums
|
||||
|
||||
static ushort CalculateCCITT_CRC16(byte[] buffer)
|
||||
{
|
||||
UInt16 CRC16=0;
|
||||
for (int i = 0; i < buffer.Length; i++) {
|
||||
UInt16 CRC16 = 0;
|
||||
for (int i = 0; i < buffer.Length; i++)
|
||||
{
|
||||
CRC16 = (ushort)(CCITT_CRC16Table[(CRC16 >> 8) ^ buffer[i]] ^ (CRC16 << 8));
|
||||
}
|
||||
CRC16 = (ushort)~CRC16;
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
2015-10-18 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* CDChecksums.cs:
|
||||
* ReedSolomon.cs:
|
||||
* DiscImageChef.Checksums.csproj:
|
||||
Added specific console handling for standard, verbose, debug
|
||||
and error outputs.
|
||||
|
||||
2015-10-05 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* MD5Context.cs:
|
||||
|
||||
@@ -56,5 +56,9 @@
|
||||
<Project>{F8BDF57B-1571-4CD0-84B3-B422088D359A}</Project>
|
||||
<Name>DiscImageChef.Helpers</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\DiscImageChef.Console\DiscImageChef.Console.csproj">
|
||||
<Project>{CCAA7AFE-C094-4D82-A66D-630DE8A3F545}</Project>
|
||||
<Name>DiscImageChef.Console</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -64,6 +64,7 @@ Copyright (C) 1995 Hari Thirumoorthy
|
||||
*/
|
||||
|
||||
using System;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.Checksums
|
||||
{
|
||||
@@ -443,8 +444,8 @@ namespace DiscImageChef.Checksums
|
||||
lambda[j] ^= Alpha_to[modnn(u + tmp)];
|
||||
}
|
||||
}
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
|
||||
#if DEBUG
|
||||
/* find roots of the erasure location polynomial */
|
||||
for (i = 1; i <= no_eras; i++)
|
||||
reg[i] = Index_of[lambda[i]];
|
||||
@@ -470,15 +471,15 @@ namespace DiscImageChef.Checksums
|
||||
}
|
||||
if (count != no_eras)
|
||||
{
|
||||
Console.WriteLine("\n lambda(x) is WRONG\n");
|
||||
DicConsole.DebugWriteLine("Reed Solomon", "\n lambda(x) is WRONG\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
Console.WriteLine("\n Erasure positions as determined by roots of Eras Loc Poly:\n");
|
||||
DicConsole.DebugWriteLine("Reed Solomon", "\n Erasure positions as determined by roots of Eras Loc Poly:\n");
|
||||
for (i = 0; i < count; i++)
|
||||
Console.WriteLine("{0} ", loc[i]);
|
||||
Console.WriteLine("\n");
|
||||
}
|
||||
DicConsole.DebugWriteLine("Reed Solomon", "{0} ", loc[i]);
|
||||
DicConsole.DebugWriteLine("Reed Solomon", "\n");
|
||||
#endif
|
||||
}
|
||||
for (i = 0; i < NN - KK + 1; i++)
|
||||
b[i] = Index_of[lambda[i]];
|
||||
@@ -572,13 +573,13 @@ namespace DiscImageChef.Checksums
|
||||
}
|
||||
}
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("\n Final error positions:\t");
|
||||
#if DEBUG
|
||||
DicConsole.DebugWriteLine("Reed Solomon", "\n Final error positions:\t");
|
||||
for (i = 0; i < count; i++)
|
||||
Console.WriteLine("{0} ", loc[i]);
|
||||
Console.WriteLine("\n");
|
||||
}
|
||||
DicConsole.DebugWriteLine("Reed Solomon", "{0} ", loc[i]);
|
||||
DicConsole.DebugWriteLine("Reed Solomon", "\n");
|
||||
#endif
|
||||
|
||||
if (deg_lambda != count)
|
||||
{
|
||||
/*
|
||||
@@ -630,10 +631,7 @@ namespace DiscImageChef.Checksums
|
||||
}
|
||||
if (den == 0)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("\n ERROR: denominator = 0\n");
|
||||
}
|
||||
DicConsole.DebugWriteLine("Reed Solomon", "\n ERROR: denominator = 0\n");
|
||||
return -1;
|
||||
}
|
||||
/* Apply error to data */
|
||||
|
||||
8
DiscImageChef.Console/ChangeLog
Normal file
8
DiscImageChef.Console/ChangeLog
Normal file
@@ -0,0 +1,8 @@
|
||||
2015-10-18 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* DicConsole.cs:
|
||||
* Properties/AssemblyInfo.cs:
|
||||
* DiscImageChef.Console.csproj:
|
||||
Added specific console handling for standard, verbose, debug
|
||||
and error outputs.
|
||||
|
||||
161
DiscImageChef.Console/DicConsole.cs
Normal file
161
DiscImageChef.Console/DicConsole.cs
Normal file
@@ -0,0 +1,161 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : DicConsole.cs
|
||||
// Version : 1.0
|
||||
// Author(s) : Natalia Portillo
|
||||
//
|
||||
// Component : Console
|
||||
//
|
||||
// Revision : $Revision$
|
||||
// Last change by : $Author$
|
||||
// Date : $Date$
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Handlers for normal, verbose and debug consoles
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright (C) 2011-2015 Claunia.com
|
||||
// ****************************************************************************/
|
||||
// //$Id$
|
||||
using System;
|
||||
|
||||
namespace DiscImageChef.Console
|
||||
{
|
||||
public delegate void WriteLineHandler(string format, params object[] arg);
|
||||
public delegate void ErrorWriteLineHandler(string format, params object[] arg);
|
||||
public delegate void VerboseWriteLineHandler(string format, params object[] arg);
|
||||
public delegate void DebugWriteLineHandler(string format, params object[] arg);
|
||||
|
||||
public delegate void WriteHandler(string format, params object[] arg);
|
||||
public delegate void ErrorWriteHandler(string format, params object[] arg);
|
||||
public delegate void VerboseWriteHandler(string format, params object[] arg);
|
||||
public delegate void DebugWriteHandler(string format, params object[] arg);
|
||||
|
||||
public static class DicConsole
|
||||
{
|
||||
public static event WriteLineHandler WriteLineEvent;
|
||||
public static event ErrorWriteLineHandler ErrorWriteLineEvent;
|
||||
public static event VerboseWriteLineHandler VerboseWriteLineEvent;
|
||||
public static event DebugWriteLineHandler DebugWriteLineEvent;
|
||||
|
||||
public static event WriteHandler WriteEvent;
|
||||
public static event ErrorWriteHandler ErrorWriteEvent;
|
||||
public static event VerboseWriteHandler VerboseWriteEvent;
|
||||
public static event DebugWriteHandler DebugWriteEvent;
|
||||
|
||||
public static void WriteLine(string format, params object[] arg)
|
||||
{
|
||||
if (WriteLineEvent != null)
|
||||
WriteLineEvent(format, arg);
|
||||
}
|
||||
|
||||
public static void ErrorWriteLine(string format, params object[] arg)
|
||||
{
|
||||
if (ErrorWriteLineEvent != null)
|
||||
ErrorWriteLineEvent(format, arg);
|
||||
}
|
||||
|
||||
public static void VerboseWriteLine(string format, params object[] arg)
|
||||
{
|
||||
if (VerboseWriteLineEvent != null)
|
||||
VerboseWriteLineEvent(format, arg);
|
||||
}
|
||||
|
||||
public static void DebugWriteLine(string module, string format, params object[] arg)
|
||||
{
|
||||
if (DebugWriteLineEvent != null)
|
||||
DebugWriteLineEvent("DEBUG (" + module + "): " + format, arg);
|
||||
}
|
||||
|
||||
public static void WriteLine()
|
||||
{
|
||||
if (WriteLineEvent != null)
|
||||
WriteLineEvent("", null);
|
||||
}
|
||||
|
||||
public static void ErrorWriteLine()
|
||||
{
|
||||
if (ErrorWriteLineEvent != null)
|
||||
ErrorWriteLineEvent("", null);
|
||||
}
|
||||
|
||||
public static void VerboseWriteLine()
|
||||
{
|
||||
if (VerboseWriteLineEvent != null)
|
||||
VerboseWriteLineEvent("", null);
|
||||
}
|
||||
|
||||
public static void DebugWriteLine()
|
||||
{
|
||||
if (DebugWriteLineEvent != null)
|
||||
DebugWriteLineEvent("", null);
|
||||
}
|
||||
|
||||
public static void Write(string format, params object[] arg)
|
||||
{
|
||||
if (WriteEvent != null)
|
||||
WriteEvent(format, arg);
|
||||
}
|
||||
|
||||
public static void ErrorWrite(string format, params object[] arg)
|
||||
{
|
||||
if (ErrorWriteEvent != null)
|
||||
ErrorWriteEvent(format, arg);
|
||||
}
|
||||
|
||||
public static void VerboseWrite(string format, params object[] arg)
|
||||
{
|
||||
if (VerboseWriteEvent != null)
|
||||
VerboseWriteEvent(format, arg);
|
||||
}
|
||||
|
||||
public static void DebugWrite(string module, string format, params object[] arg)
|
||||
{
|
||||
if (DebugWriteEvent != null)
|
||||
DebugWriteEvent("DEBUG (" + module + "): " + format, arg);
|
||||
}
|
||||
|
||||
public static void Write()
|
||||
{
|
||||
if (WriteEvent != null)
|
||||
WriteEvent("", null);
|
||||
}
|
||||
|
||||
public static void ErrorWrite()
|
||||
{
|
||||
if (ErrorWriteEvent != null)
|
||||
ErrorWriteEvent("", null);
|
||||
}
|
||||
|
||||
public static void VerboseWrite()
|
||||
{
|
||||
if (VerboseWriteEvent != null)
|
||||
VerboseWriteEvent("", null);
|
||||
}
|
||||
|
||||
public static void DebugWrite()
|
||||
{
|
||||
if (DebugWriteEvent != null)
|
||||
DebugWriteEvent("", null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
41
DiscImageChef.Console/DiscImageChef.Console.csproj
Normal file
41
DiscImageChef.Console/DiscImageChef.Console.csproj
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{CCAA7AFE-C094-4D82-A66D-630DE8A3F545}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>DiscImageChef.Console</RootNamespace>
|
||||
<AssemblyName>DiscImageChef.Console</AssemblyName>
|
||||
<ReleaseVersion>2.2</ReleaseVersion>
|
||||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug</OutputPath>
|
||||
<DefineConstants>DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release</OutputPath>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="DicConsole.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
64
DiscImageChef.Console/Properties/AssemblyInfo.cs
Normal file
64
DiscImageChef.Console/Properties/AssemblyInfo.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : AssemblyInfo.cs
|
||||
// Version : 1.0
|
||||
// Author(s) : Natalia Portillo
|
||||
//
|
||||
// Component : Component
|
||||
//
|
||||
// Revision : $Revision$
|
||||
// Last change by : $Author$
|
||||
// Date : $Date$
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Description
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as
|
||||
// published by the Free Software Foundation, either version 3 of the
|
||||
// License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright (C) 2011-2015 Claunia.com
|
||||
// ****************************************************************************/
|
||||
// //$Id$
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
// Information about this assembly is defined by the following attributes.
|
||||
// Change them to the values specific to your project.
|
||||
|
||||
[assembly: AssemblyTitle("DiscImageChef.Console")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Claunia.com")]
|
||||
[assembly: AssemblyProduct("")]
|
||||
[assembly: AssemblyCopyright("© Claunia.com")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
|
||||
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
|
||||
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
|
||||
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
// The following attributes are used to specify the signing key for the assembly,
|
||||
// if desired. See the Mono documentation for more information about signing.
|
||||
|
||||
//[assembly: AssemblyDelaySign(false)]
|
||||
//[assembly: AssemblyKeyFile("")]
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.Decoders
|
||||
{
|
||||
@@ -1852,9 +1853,15 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
public static IdentifyDevice? DecodeIdentifyDevice(byte[] IdentifyDeviceResponse)
|
||||
{
|
||||
if (IdentifyDeviceResponse.Length != 512)
|
||||
if (IdentifyDeviceResponse != null)
|
||||
return null;
|
||||
|
||||
if (IdentifyDeviceResponse.Length != 512)
|
||||
{
|
||||
DicConsole.DebugWriteLine("ATA/ATAPI IDENTIFY decoder", "IDENTIFY response is different than 512 bytes, not decoding.");
|
||||
return null;
|
||||
}
|
||||
|
||||
//IdentifyDevice ATAID = new IdentifyDevice();
|
||||
|
||||
IntPtr ptr = Marshal.AllocHGlobal(512);
|
||||
|
||||
@@ -38,6 +38,7 @@ Copyright (C) 2011-2014 Claunia.com
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.Decoders
|
||||
{
|
||||
@@ -81,8 +82,7 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
if (DIResponse.Length != 4100)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (BD Disc Information): Found incorrect Blu-ray Disc Information size ({0} bytes)", DIResponse.Length);
|
||||
DicConsole.DebugWriteLine("BD Disc Information decoder", "Found incorrect Blu-ray Disc Information size ({0} bytes)", DIResponse.Length);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -141,8 +141,7 @@ namespace DiscImageChef.Decoders
|
||||
}
|
||||
default:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (BD Disc Information): Found unknown disc type identifier \"{0}\"", Encoding.ASCII.GetString(unit.DiscTypeIdentifier));
|
||||
DicConsole.DebugWriteLine("BD Disc Information decoder", "Found unknown disc type identifier \"{0}\"", Encoding.ASCII.GetString(unit.DiscTypeIdentifier));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -210,8 +209,7 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
if (BCAResponse.Length != 68)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (BD BCA): Found incorrect Blu-ray BCA size ({0} bytes)", BCAResponse.Length);
|
||||
DicConsole.DebugWriteLine("BD BCA decoder", "Found incorrect Blu-ray BCA size ({0} bytes)", BCAResponse.Length);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -238,11 +236,13 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
sb.AppendFormat("DEBUG (BD BCA): Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
sb.AppendFormat("DEBUG (BD BCA): Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
}
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
#endif
|
||||
|
||||
sb.AppendFormat("Blu-ray Burst Cutting Area in hex follows:");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.BCA, 80));
|
||||
|
||||
@@ -270,8 +270,7 @@ namespace DiscImageChef.Decoders
|
||||
decoded.Signature = BigEndianBitConverter.ToUInt16(DDSResponse, 4);
|
||||
if (decoded.Signature != DDSIdentifier)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (BD DDS): Found incorrect DDS signature (0x{0:X4})", decoded.Signature);
|
||||
DicConsole.DebugWriteLine("BD DDS decoder", "Found incorrect DDS signature (0x{0:X4})", decoded.Signature);
|
||||
|
||||
return null;
|
||||
|
||||
@@ -312,19 +311,6 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
sb.AppendFormat("DEBUG (BD Disc Definition Structure): Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
sb.AppendFormat("DEBUG (BD Disc Definition Structure): Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
sb.AppendFormat("DEBUG (BD Disc Definition Structure): Reserved3 = 0x{0:X2}", response.Reserved3).AppendLine();
|
||||
sb.AppendFormat("DEBUG (BD Disc Definition Structure): Reserved4 = 0x{0:X16}", response.Reserved4).AppendLine();
|
||||
sb.AppendFormat("DEBUG (BD Disc Definition Structure): Reserved5 = 0x{0:X8}", response.Reserved5).AppendLine();
|
||||
sb.AppendFormat("DEBUG (BD Disc Definition Structure): Reserved6 = 0x{0:X8}", response.Reserved6).AppendLine();
|
||||
sb.AppendFormat("DEBUG (BD Disc Definition Structure): Reserved7 = 0x{0:X2}", response.Reserved7).AppendLine();
|
||||
sb.AppendFormat("DEBUG (BD Disc Definition Structure): Reserved8 = 0x{0:X2}", response.Reserved8).AppendLine();
|
||||
sb.AppendFormat("DEBUG (BD Disc Definition Structure): Reserved9 = 0x{0:X8}", response.Reserved9).AppendLine();
|
||||
}
|
||||
|
||||
sb.AppendFormat("DDS Format: 0x{0:X2}", response.Format).AppendLine();
|
||||
sb.AppendFormat("DDS has ben updated {0} times", response.UpdateCount).AppendLine();
|
||||
sb.AppendFormat("First PSN of Drive Area: 0x{0:X8}", response.DriveAreaPSN).AppendLine();
|
||||
@@ -342,6 +328,27 @@ namespace DiscImageChef.Decoders
|
||||
sb.AppendFormat("Blu-ray DDS Disc Type Specific Data in hex follows:");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.DiscTypeSpecificData, 80));
|
||||
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
if(response.Reserved3 != 0)
|
||||
sb.AppendFormat("Reserved3 = 0x{0:X2}", response.Reserved3).AppendLine();
|
||||
if(response.Reserved4 != 0)
|
||||
sb.AppendFormat("Reserved4 = 0x{0:X16}", response.Reserved4).AppendLine();
|
||||
if(response.Reserved5 != 0)
|
||||
sb.AppendFormat("Reserved5 = 0x{0:X8}", response.Reserved5).AppendLine();
|
||||
if(response.Reserved6 != 0)
|
||||
sb.AppendFormat("Reserved6 = 0x{0:X8}", response.Reserved6).AppendLine();
|
||||
if(response.Reserved7 != 0)
|
||||
sb.AppendFormat("Reserved7 = 0x{0:X2}", response.Reserved7).AppendLine();
|
||||
if(response.Reserved8 != 0)
|
||||
sb.AppendFormat("Reserved8 = 0x{0:X2}", response.Reserved8).AppendLine();
|
||||
if(response.Reserved9 != 0)
|
||||
sb.AppendFormat("Reserved9 = 0x{0:X8}", response.Reserved9).AppendLine();
|
||||
#endif
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@@ -358,8 +365,7 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
if (CSResponse.Length != 8)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (BD Cartridge Status): Found incorrect Blu-ray Spare Area Information size ({0} bytes)", CSResponse.Length);
|
||||
DicConsole.DebugWriteLine("BD Cartridge Status decoder", "Found incorrect Blu-ray Cartridge Status size ({0} bytes)", CSResponse.Length);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -392,16 +398,22 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
sb.AppendFormat("DEBUG (BD Cartridge Status): Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
sb.AppendFormat("DEBUG (BD Cartridge Status): Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
sb.AppendFormat("DEBUG (BD Cartridge Status): Reserved3 = 0x{0:X8}", response.Reserved3).AppendLine();
|
||||
sb.AppendFormat("DEBUG (BD Cartridge Status): Reserved4 = 0x{0:X8}", response.Reserved4).AppendLine();
|
||||
sb.AppendFormat("DEBUG (BD Cartridge Status): Reserved5 = 0x{0:X8}", response.Reserved5).AppendLine();
|
||||
sb.AppendFormat("DEBUG (BD Cartridge Status): Reserved6 = 0x{0:X8}", response.Reserved6).AppendLine();
|
||||
sb.AppendFormat("DEBUG (BD Cartridge Status): Reserved7 = 0x{0:X8}", response.Reserved7).AppendLine();
|
||||
}
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
if(response.Reserved3 != 0)
|
||||
sb.AppendFormat("Reserved3 = 0x{0:X8}", response.Reserved3).AppendLine();
|
||||
if(response.Reserved4 != 0)
|
||||
sb.AppendFormat("Reserved4 = 0x{0:X8}", response.Reserved4).AppendLine();
|
||||
if(response.Reserved5 != 0)
|
||||
sb.AppendFormat("Reserved5 = 0x{0:X8}", response.Reserved5).AppendLine();
|
||||
if(response.Reserved6 != 0)
|
||||
sb.AppendFormat("Reserved6 = 0x{0:X8}", response.Reserved6).AppendLine();
|
||||
if(response.Reserved7 != 0)
|
||||
sb.AppendFormat("Reserved7 = 0x{0:X8}", response.Reserved7).AppendLine();
|
||||
#endif
|
||||
|
||||
if (response.Cartridge)
|
||||
{
|
||||
@@ -414,13 +426,13 @@ namespace DiscImageChef.Decoders
|
||||
else
|
||||
{
|
||||
sb.AppendLine("Media is not in a cartridge");
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
|
||||
#if DEBUG
|
||||
if (response.OUT)
|
||||
sb.AppendLine("Media has out bit marked, shouldn't");
|
||||
if (response.CWP)
|
||||
sb.AppendLine("Media has write protection bit marked, shouldn't");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return sb.ToString();
|
||||
}
|
||||
@@ -438,8 +450,7 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
if (SAIResponse.Length != 16)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (BD Spare Area Information): Found incorrect Blu-ray Spare Area Information size ({0} bytes)", SAIResponse.Length);
|
||||
DicConsole.DebugWriteLine("BD Spare Area Information decoder", "Found incorrect Blu-ray Spare Area Information size ({0} bytes)", SAIResponse.Length);
|
||||
|
||||
return null;
|
||||
}
|
||||
@@ -467,12 +478,14 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
sb.AppendFormat("DEBUG (BD Spare Area Information): Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
sb.AppendFormat("DEBUG (BD Spare Area Information): Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
sb.AppendFormat("DEBUG (BD Spare Area Information): Reserved3 = 0x{0:X8}", response.Reserved3).AppendLine();
|
||||
}
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
if(response.Reserved3 != 0)
|
||||
sb.AppendFormat("Reserved3 = 0x{0:X8}", response.Reserved3).AppendLine();
|
||||
#endif
|
||||
sb.AppendFormat("{0} free spare blocks", response.FreeSpareBlocks).AppendLine();
|
||||
sb.AppendFormat("{0} allocated spare blocks", response.AllocatedSpareBlocks).AppendLine();
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ Copyright (C) 2011-2014 Claunia.com
|
||||
//$Id$
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.Decoders
|
||||
{
|
||||
@@ -203,8 +204,7 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
if (decoded.DataLength + 2 != CDTOCResponse.Length)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDTOC Decoder): Expected CDTOC size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDTOCResponse.Length);
|
||||
DicConsole.DebugWriteLine("CD TOC decoder", "Expected CDTOC size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDTOCResponse.Length);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -287,11 +287,12 @@ namespace DiscImageChef.Decoders
|
||||
else
|
||||
sb.AppendLine("Digital copy of track is prohibited");
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
sb.AppendFormat("Reserved1: {0:X2}", descriptor.Reserved1).AppendLine();
|
||||
sb.AppendFormat("Reserved2: {0:X2}", descriptor.Reserved2).AppendLine();
|
||||
}
|
||||
#if DEBUG
|
||||
if(descriptor.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", descriptor.Reserved1).AppendLine();
|
||||
if(descriptor.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", descriptor.Reserved2).AppendLine();
|
||||
#endif
|
||||
|
||||
sb.AppendLine();
|
||||
}
|
||||
@@ -322,8 +323,7 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
if (decoded.DataLength + 2 != CDSessionInfoResponse.Length)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDSessionInfo Decoder): Expected CDSessionInfo size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDSessionInfoResponse.Length);
|
||||
DicConsole.DebugWriteLine("CD Session Info decoder", "Expected CDSessionInfo size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDSessionInfoResponse.Length);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -406,11 +406,12 @@ namespace DiscImageChef.Decoders
|
||||
else
|
||||
sb.AppendLine("Digital copy of track is prohibited");
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
sb.AppendFormat("Reserved1: {0:X2}", descriptor.Reserved1).AppendLine();
|
||||
sb.AppendFormat("Reserved2: {0:X2}", descriptor.Reserved2).AppendLine();
|
||||
}
|
||||
#if DEBUG
|
||||
if(descriptor.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", descriptor.Reserved1).AppendLine();
|
||||
if(descriptor.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", descriptor.Reserved2).AppendLine();
|
||||
#endif
|
||||
|
||||
sb.AppendLine();
|
||||
}
|
||||
@@ -441,8 +442,7 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
if (decoded.DataLength + 2 != CDFullTOCResponse.Length)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDFullTOC Decoder): Expected CDFullTOC size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDFullTOCResponse.Length);
|
||||
DicConsole.DebugWriteLine("CD full TOC decoder", "Expected CDFullTOC size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDFullTOCResponse.Length);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -600,8 +600,6 @@ namespace DiscImageChef.Decoders
|
||||
case 0xC1:
|
||||
{
|
||||
sb.AppendFormat("Copy of information of A1 from ATIP found");
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
sb.AppendFormat("Min = {0}", descriptor.Min).AppendLine();
|
||||
sb.AppendFormat("Sec = {0}", descriptor.Sec).AppendLine();
|
||||
sb.AppendFormat("Frame = {0}", descriptor.Frame).AppendLine();
|
||||
@@ -609,7 +607,6 @@ namespace DiscImageChef.Decoders
|
||||
sb.AppendFormat("PMIN = {0}", descriptor.PMIN).AppendLine();
|
||||
sb.AppendFormat("PSEC = {0}", descriptor.PSEC).AppendLine();
|
||||
sb.AppendFormat("PFRAME = {0}", descriptor.PFRAME).AppendLine();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0xCF:
|
||||
@@ -674,8 +671,7 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
if (decoded.DataLength + 2 != CDPMAResponse.Length)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDPMA Decoder): Expected CDPMA size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDPMAResponse.Length);
|
||||
DicConsole.DebugWriteLine("CD PMA decoder", "Expected CDPMA size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDPMAResponse.Length);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -708,15 +704,20 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
sb.AppendFormat("Reserved1: 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
sb.AppendFormat("Reserved2: 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
}
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
#endif
|
||||
|
||||
foreach (CDPMADescriptors descriptor in response.PMADescriptors)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
sb.AppendFormat("Reserved1: 0x{0:X2}", descriptor.Reserved).AppendLine();
|
||||
#if DEBUG
|
||||
if(descriptor.Reserved != 0)
|
||||
sb.AppendFormat("Reserved = 0x{0:X2}", descriptor.Reserved).AppendLine();
|
||||
#endif
|
||||
|
||||
sb.AppendFormat("ADR = {0}", descriptor.ADR).AppendLine();
|
||||
sb.AppendFormat("CONTROL = {0}", descriptor.CONTROL).AppendLine();
|
||||
sb.AppendFormat("TNO = {0}", descriptor.TNO).AppendLine();
|
||||
@@ -751,8 +752,7 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
if (CDATIPResponse.Length != 32)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDATIP Decoder): Expected CDATIP size (32 bytes) is not received size ({0} bytes), not decoding", CDATIPResponse.Length);
|
||||
DicConsole.DebugWriteLine("CD ATIP decoder", "Expected CD ATIP size (32 bytes) is not received size ({0} bytes), not decoding", CDATIPResponse.Length);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -912,8 +912,7 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
if (decoded.DataLength + 2 != CDTextResponse.Length)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CD-TEXT Decoder): Expected CD-TEXT size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDTextResponse.Length);
|
||||
DicConsole.DebugWriteLine("CD-TEXT decoder", "Expected CD-TEXT size ({0} bytes) is not received size ({1} bytes), not decoding", decoded.DataLength + 2, CDTextResponse.Length);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -942,11 +941,12 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
sb.AppendFormat("Reserved1: 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
sb.AppendFormat("Reserved2: 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
}
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
#endif
|
||||
foreach (CDTextPack descriptor in response.DataPacks)
|
||||
{
|
||||
if ((descriptor.HeaderID1 & 0x80) != 0x80)
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
2015-10-18 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* BD.cs:
|
||||
* CD.cs:
|
||||
* ATA.cs:
|
||||
* MMC.cs:
|
||||
* SCSI.cs:
|
||||
* DiscImageChef.Decoders.csproj:
|
||||
Added specific console handling for standard, verbose, debug
|
||||
and error outputs.
|
||||
|
||||
2015-10-17 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* SCSI.cs:
|
||||
|
||||
@@ -48,5 +48,9 @@
|
||||
<Project>{F8BDF57B-1571-4CD0-84B3-B422088D359A}</Project>
|
||||
<Name>DiscImageChef.Helpers</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\DiscImageChef.Console\DiscImageChef.Console.csproj">
|
||||
<Project>{CCAA7AFE-C094-4D82-A66D-630DE8A3F545}</Project>
|
||||
<Name>DiscImageChef.Console</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -131,11 +131,12 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
sb.AppendFormat("DEBUG (AACS Volume Identifier): Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
sb.AppendFormat("DEBUG (AACS Volume Identifier): Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
}
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
#endif
|
||||
sb.AppendFormat("AACS Volume Identifier in hex follows:");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.VolumeIdentifier, 80));
|
||||
|
||||
@@ -176,11 +177,12 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
sb.AppendFormat("DEBUG (AACS Media Serial Number): Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
sb.AppendFormat("DEBUG (AACS Media Serial Number): Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
}
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
#endif
|
||||
sb.AppendFormat("AACS Media Serial Number in hex follows:");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.MediaSerialNumber, 80));
|
||||
|
||||
@@ -221,11 +223,12 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
sb.AppendFormat("DEBUG (AACS Media Identifier): Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
sb.AppendFormat("DEBUG (AACS Media Identifier): Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
}
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
#endif
|
||||
sb.AppendFormat("AACS Media Identifier in hex follows:");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.MediaIdentifier, 80));
|
||||
|
||||
@@ -266,10 +269,10 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
sb.AppendFormat("DEBUG (AACS Media Key Block): Reserved = 0x{0:X2}", response.Reserved).AppendLine();
|
||||
}
|
||||
#if DEBUG
|
||||
if(response.Reserved != 0)
|
||||
sb.AppendFormat("Reserved = 0x{0:X2}", response.Reserved).AppendLine();
|
||||
#endif
|
||||
sb.AppendFormat("Total number of media key blocks available to transfer {0}", response.TotalPacks).AppendLine();
|
||||
sb.AppendFormat("AACS Media Key Blocks in hex follows:");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.MediaKeyBlockPacks, 80));
|
||||
@@ -311,11 +314,12 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
sb.AppendFormat("DEBUG (AACS Data Keys): Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
sb.AppendFormat("DEBUG (AACS Data Keys): Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
}
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
#endif
|
||||
sb.AppendFormat("AACS Data Keys in hex follows:");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.DataKeys, 80));
|
||||
|
||||
@@ -416,10 +420,10 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
sb.AppendFormat("DEBUG (CPRM Media Key Block): Reserved1 = 0x{0:X2}", response.Reserved).AppendLine();
|
||||
}
|
||||
#if DEBUG
|
||||
if(response.Reserved != 0)
|
||||
sb.AppendFormat("Reserved = 0x{0:X2}", response.Reserved).AppendLine();
|
||||
#endif
|
||||
sb.AppendFormat("Total number of CPRM Media Key Blocks available to transfer: {0}", response.TotalPacks).AppendLine();
|
||||
sb.AppendFormat("CPRM Media Key Blocks in hex follows:");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.MKBPackData, 80));
|
||||
@@ -578,15 +582,20 @@ namespace DiscImageChef.Decoders
|
||||
if (response.SWPP)
|
||||
sb.AppendLine("Software write protection is set until power down");
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
sb.AppendFormat("DEBUG (Write Protection Status): Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
sb.AppendFormat("DEBUG (Write Protection Status): Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
sb.AppendFormat("DEBUG (Write Protection Status): Reserved3 = 0x{0:X2}", response.Reserved3).AppendLine();
|
||||
sb.AppendFormat("DEBUG (Write Protection Status): Reserved4 = 0x{0:X2}", response.Reserved4).AppendLine();
|
||||
sb.AppendFormat("DEBUG (Write Protection Status): Reserved5 = 0x{0:X2}", response.Reserved5).AppendLine();
|
||||
sb.AppendFormat("DEBUG (Write Protection Status): Reserved6 = 0x{0:X2}", response.Reserved6).AppendLine();
|
||||
}
|
||||
#if DEBUG
|
||||
if(response.Reserved1 != 0)
|
||||
sb.AppendFormat("Reserved1 = 0x{0:X2}", response.Reserved1).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved2 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
if(response.Reserved3 != 0)
|
||||
sb.AppendFormat("Reserved3 = 0x{0:X2}", response.Reserved3).AppendLine();
|
||||
if(response.Reserved4 != 0)
|
||||
sb.AppendFormat("Reserved4 = 0x{0:X2}", response.Reserved4).AppendLine();
|
||||
if(response.Reserved5 != 0)
|
||||
sb.AppendFormat("Reserved5 = 0x{0:X2}", response.Reserved5).AppendLine();
|
||||
if(response.Reserved6 != 0)
|
||||
sb.AppendFormat("Reserved6 = 0x{0:X2}", response.Reserved6).AppendLine();
|
||||
#endif
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ Copyright (C) 2011-2014 Claunia.com
|
||||
//$Id$
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.Decoders
|
||||
{
|
||||
@@ -1890,17 +1891,13 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
if (SCSIInquiryResponse.Length < 36)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (SCSI INQUIRY Decoder): INQUIRY response is less than minimum of 36 bytes, decoded data can be incorrect, proceeding anyway.");
|
||||
//else
|
||||
DicConsole.DebugWriteLine("SCSI INQUIRY decoder", "INQUIRY response is less than minimum of 36 bytes, decoded data can be incorrect, not decoding.");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (SCSIInquiryResponse.Length != SCSIInquiryResponse[4] + 5)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (SCSI INQUIRY Decoder): INQUIRY response length ({0} bytes) is different than specified in length field ({1} bytes), decoded data can be incorrect, proceeding anyway.", SCSIInquiryResponse.Length, SCSIInquiryResponse[4] + 4);
|
||||
//else
|
||||
DicConsole.DebugWriteLine("SCSI INQUIRY decoder", "INQUIRY response length ({0} bytes) is different than specified in length field ({1} bytes), decoded data can be incorrect, not decoding.", SCSIInquiryResponse.Length, SCSIInquiryResponse[4] + 4);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -2233,11 +2230,10 @@ namespace DiscImageChef.Decoders
|
||||
sb.AppendLine("Device supports information unit transfers");
|
||||
if (response.SftRe)
|
||||
sb.AppendLine("Device implements RESET as a soft reset");
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
#if DEBUG
|
||||
if (response.VS1)
|
||||
sb.AppendLine("Vendor specific bit 5 on byte 6 of INQUIRY response is set");
|
||||
}
|
||||
#endif
|
||||
|
||||
switch ((SCSITGPSValues)response.TPGS)
|
||||
{
|
||||
@@ -3694,16 +3690,19 @@ namespace DiscImageChef.Decoders
|
||||
}
|
||||
}
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
sb.AppendFormat("DEBUG (SCSIInquiry Decoder): Vendor's device type modifier = 0x{0:X2}", response.DeviceTypeModifier).AppendLine();
|
||||
sb.AppendFormat("DEBUG (SCSIInquiry Decoder): Reserved byte 5, bits 2 to 1 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
sb.AppendFormat("DEBUG (SCSIInquiry Decoder): Reserved byte 56, bits 7 to 4 = 0x{0:X2}", response.Reserved3).AppendLine();
|
||||
sb.AppendFormat("DEBUG (SCSIInquiry Decoder): Reserved byte 57 = 0x{0:X2}", response.Reserved4).AppendLine();
|
||||
#if DEBUG
|
||||
if(response.DeviceTypeModifier != 0)
|
||||
sb.AppendFormat("Vendor's device type modifier = 0x{0:X2}", response.DeviceTypeModifier).AppendLine();
|
||||
if(response.Reserved2 != 0)
|
||||
sb.AppendFormat("Reserved byte 5, bits 2 to 1 = 0x{0:X2}", response.Reserved2).AppendLine();
|
||||
if(response.Reserved3 != 0)
|
||||
sb.AppendFormat("Reserved byte 56, bits 7 to 4 = 0x{0:X2}", response.Reserved3).AppendLine();
|
||||
if(response.Reserved4 != 0)
|
||||
sb.AppendFormat("Reserved byte 57 = 0x{0:X2}", response.Reserved4).AppendLine();
|
||||
|
||||
if (response.Reserved5 != null)
|
||||
{
|
||||
sb.AppendLine("DEBUG (SCSIInquiry Decoder): Reserved bytes 74 to 95");
|
||||
sb.AppendLine("Reserved bytes 74 to 95");
|
||||
sb.AppendLine("============================================================");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.Reserved5, 60));
|
||||
sb.AppendLine("============================================================");
|
||||
@@ -3711,7 +3710,7 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
if (response.VendorSpecific != null)
|
||||
{
|
||||
sb.AppendLine("DEBUG (SCSIInquiry Decoder): Vendor-specific bytes 36 to 55");
|
||||
sb.AppendLine("Vendor-specific bytes 36 to 55");
|
||||
sb.AppendLine("============================================================");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.VendorSpecific, 60));
|
||||
sb.AppendLine("============================================================");
|
||||
@@ -3719,12 +3718,12 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
if (response.VendorSpecific2 != null)
|
||||
{
|
||||
sb.AppendFormat("DEBUG (SCSIInquiry Decoder): Vendor-specific bytes 96 to {0}", response.AdditionalLength+4).AppendLine();
|
||||
sb.AppendFormat("Vendor-specific bytes 96 to {0}", response.AdditionalLength+4).AppendLine();
|
||||
sb.AppendLine("============================================================");
|
||||
sb.AppendLine(PrintHex.ByteArrayToHexArrayString(response.VendorSpecific2, 60));
|
||||
sb.AppendLine("============================================================");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
2015-10-18 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Device/AtaCommands.cs:
|
||||
* Device/ScsiCommands.cs:
|
||||
* Device/AtapiCommands.cs:
|
||||
* DiscImageChef.Devices.csproj:
|
||||
Added specific console handling for standard, verbose, debug
|
||||
and error outputs.
|
||||
|
||||
2015-10-17 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Enums.cs:
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
// ****************************************************************************/
|
||||
// //$Id$
|
||||
using System;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.Devices
|
||||
{
|
||||
@@ -97,9 +98,7 @@ namespace DiscImageChef.Devices
|
||||
ref buffer, timeout, false, out duration, out sense);
|
||||
error = lastError != 0;
|
||||
|
||||
#if DEBUG
|
||||
Console.WriteLine("ATA IDENTIFY DEVICE took {0} ms.", duration);
|
||||
#endif
|
||||
DicConsole.DebugWriteLine("ATA Device", "IDENTIFY DEVICE took {0} ms.", duration);
|
||||
|
||||
return sense;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
// ****************************************************************************/
|
||||
// //$Id$
|
||||
using System;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.Devices
|
||||
{
|
||||
@@ -97,9 +98,7 @@ namespace DiscImageChef.Devices
|
||||
ref buffer, timeout, false, out duration, out sense);
|
||||
error = lastError != 0;
|
||||
|
||||
#if DEBUG
|
||||
Console.WriteLine("ATA IDENTIFY PACKET DEVICE took {0} ms.", duration);
|
||||
#endif
|
||||
DicConsole.DebugWriteLine("ATA Device", "IDENTIFY PACKET DEVICE took {0} ms.", duration);
|
||||
|
||||
return sense;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
// ****************************************************************************/
|
||||
// //$Id$
|
||||
using System;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.Devices
|
||||
{
|
||||
@@ -107,9 +108,7 @@ namespace DiscImageChef.Devices
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, Enums.ScsiDirection.In, out duration, out sense);
|
||||
error = lastError != 0;
|
||||
|
||||
#if DEBUG
|
||||
Console.WriteLine("SCSI INQUIRY took {0} ms.", duration);
|
||||
#endif
|
||||
DicConsole.DebugWriteLine("SCSI Device", "INQUIRY took {0} ms.", duration);
|
||||
|
||||
return sense;
|
||||
}
|
||||
@@ -184,9 +183,7 @@ namespace DiscImageChef.Devices
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, Enums.ScsiDirection.In, out duration, out sense);
|
||||
error = lastError != 0;
|
||||
|
||||
#if DEBUG
|
||||
Console.WriteLine("SCSI INQUIRY took {0} ms.", duration);
|
||||
#endif
|
||||
DicConsole.DebugWriteLine("SCSI Device", "INQUIRY took {0} ms.", duration);
|
||||
|
||||
return sense;
|
||||
}
|
||||
|
||||
@@ -74,5 +74,9 @@
|
||||
<Project>{9183F2E0-A879-4F23-9EE3-C6908F1332B2}</Project>
|
||||
<Name>DiscImageChef.Interop</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\DiscImageChef.Console\DiscImageChef.Console.csproj">
|
||||
<Project>{CCAA7AFE-C094-4D82-A66D-630DE8A3F545}</Project>
|
||||
<Name>DiscImageChef.Console</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -39,6 +39,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
@@ -273,30 +274,26 @@ namespace DiscImageChef.ImagePlugins
|
||||
if (ImageHeader.dataSize == 0x00800C00)
|
||||
{
|
||||
ImageHeader.dataSize = 0x000C8000;
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (2MG plugin): Detected incorrect endian on data size field, correcting.");
|
||||
DicConsole.DebugWriteLine("2MG plugin", "Detected incorrect endian on data size field, correcting.");
|
||||
}
|
||||
|
||||
////if (MainClass.isDebug)
|
||||
//{
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.magic = \"{0}\"", Encoding.ASCII.GetString(magic));
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.creator = \"{0}\"", Encoding.ASCII.GetString(creator));
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.headerSize = {0}", ImageHeader.headerSize);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.version = {0}", ImageHeader.version);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.imageFormat = {0}", ImageHeader.imageFormat);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.flags = 0x{0:X8}", ImageHeader.flags);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.blocks = {0}", ImageHeader.blocks);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.dataOffset = 0x{0:X8}", ImageHeader.dataOffset);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.dataSize = {0}", ImageHeader.dataSize);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.commentOffset = 0x{0:X8}", ImageHeader.commentOffset);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.commentSize = {0}", ImageHeader.commentSize);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.creatorSpecificOffset = 0x{0:X8}", ImageHeader.creatorSpecificOffset);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.creatorSpecificSize = {0}", ImageHeader.creatorSpecificSize);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.reserved1 = 0x{0:X8}", ImageHeader.reserved1);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.reserved2 = 0x{0:X8}", ImageHeader.reserved2);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.reserved3 = 0x{0:X8}", ImageHeader.reserved3);
|
||||
Console.WriteLine("DEBUG (2MG plugin): ImageHeader.reserved4 = 0x{0:X8}", ImageHeader.reserved4);
|
||||
//}
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.magic = \"{0}\"", Encoding.ASCII.GetString(magic));
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.creator = \"{0}\"", Encoding.ASCII.GetString(creator));
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.headerSize = {0}", ImageHeader.headerSize);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.version = {0}", ImageHeader.version);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.imageFormat = {0}", ImageHeader.imageFormat);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.flags = 0x{0:X8}", ImageHeader.flags);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.blocks = {0}", ImageHeader.blocks);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.dataOffset = 0x{0:X8}", ImageHeader.dataOffset);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.dataSize = {0}", ImageHeader.dataSize);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.commentOffset = 0x{0:X8}", ImageHeader.commentOffset);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.commentSize = {0}", ImageHeader.commentSize);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.creatorSpecificOffset = 0x{0:X8}", ImageHeader.creatorSpecificOffset);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.creatorSpecificSize = {0}", ImageHeader.creatorSpecificSize);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.reserved1 = 0x{0:X8}", ImageHeader.reserved1);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.reserved2 = 0x{0:X8}", ImageHeader.reserved2);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.reserved3 = 0x{0:X8}", ImageHeader.reserved3);
|
||||
DicConsole.DebugWriteLine("2MG plugin", "ImageHeader.reserved4 = 0x{0:X8}", ImageHeader.reserved4);
|
||||
|
||||
if (ImageHeader.dataSize == 0 && ImageHeader.blocks == 0 && ImageHeader.imageFormat != ProDOSSectorOrder)
|
||||
return false;
|
||||
|
||||
@@ -43,6 +43,7 @@ using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
@@ -350,9 +351,9 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Exception trying to identify image file {0}", this.imagePath);
|
||||
Console.WriteLine("Exception: {0}", ex.Message);
|
||||
Console.WriteLine("Stack trace: {0}", ex.StackTrace);
|
||||
DicConsole.ErrorWriteLine("Exception trying to identify image file {0}", this.imagePath);
|
||||
DicConsole.ErrorWriteLine("Exception: {0}", ex.Message);
|
||||
DicConsole.ErrorWriteLine("Stack trace: {0}", ex.StackTrace);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -479,8 +480,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
if (MatchDiskType.Success && !intrack)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found REM ORIGINAL MEDIA TYPE at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found REM ORIGINAL MEDIA TYPE at line {0}", line);
|
||||
discimage.disktypestr = MatchDiskType.Groups[1].Value;
|
||||
}
|
||||
else if (MatchDiskType.Success && intrack)
|
||||
@@ -489,28 +489,24 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchSession.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found REM SESSION at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found REM SESSION at line {0}", line);
|
||||
currentsession = Byte.Parse(MatchSession.Groups[1].Value);
|
||||
|
||||
// What happens between sessions
|
||||
}
|
||||
else if (MatchLBA.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found REM MSF at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found REM MSF at line {0}", line);
|
||||
// Just ignored
|
||||
}
|
||||
else if (MatchLeadOut.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found REM LEAD-OUT at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found REM LEAD-OUT at line {0}", line);
|
||||
// Just ignored
|
||||
}
|
||||
else if (MatchComment.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found REM at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found REM at line {0}", line);
|
||||
if (discimage.comment == "")
|
||||
discimage.comment = MatchComment.Groups[1].Value; // First comment
|
||||
else
|
||||
@@ -538,8 +534,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
if (MatchArranger.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found ARRANGER at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found ARRANGER at line {0}", line);
|
||||
if (intrack)
|
||||
currenttrack.arranger = MatchArranger.Groups[1].Value;
|
||||
else
|
||||
@@ -547,8 +542,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchBarCode.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found UPC_EAN at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found UPC_EAN at line {0}", line);
|
||||
if (!intrack)
|
||||
discimage.barcode = MatchBarCode.Groups[1].Value;
|
||||
else
|
||||
@@ -556,8 +550,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchCDText.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found CDTEXTFILE at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found CDTEXTFILE at line {0}", line);
|
||||
if (!intrack)
|
||||
discimage.cdtextfile = MatchCDText.Groups[1].Value;
|
||||
else
|
||||
@@ -565,8 +558,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchComposer.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found COMPOSER at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found COMPOSER at line {0}", line);
|
||||
if (intrack)
|
||||
currenttrack.arranger = MatchComposer.Groups[1].Value;
|
||||
else
|
||||
@@ -574,8 +566,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchDiskID.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found DISC_ID at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found DISC_ID at line {0}", line);
|
||||
if (!intrack)
|
||||
discimage.disk_id = MatchDiskID.Groups[1].Value;
|
||||
else
|
||||
@@ -583,8 +574,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchFile.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found FILE at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found FILE at line {0}", line);
|
||||
|
||||
if (currenttrack.sequence != 0)
|
||||
{
|
||||
@@ -664,8 +654,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
|
||||
// File does exist, process it
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): File \"{0}\" found", currentfile.datafile);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "File \"{0}\" found", currentfile.datafile);
|
||||
|
||||
switch (currentfile.filetype)
|
||||
{
|
||||
@@ -686,15 +675,13 @@ namespace DiscImageChef.ImagePlugins
|
||||
else if (MatchFlags.Success)
|
||||
{
|
||||
// TODO: Implement FLAGS support.
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found FLAGS at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found FLAGS at line {0}", line);
|
||||
if (!intrack)
|
||||
throw new FeatureUnsupportedImageException(String.Format("Found FLAGS field in incorrect place at line {0}", line));
|
||||
}
|
||||
else if (MatchGenre.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found GENRE at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found GENRE at line {0}", line);
|
||||
if (intrack)
|
||||
currenttrack.genre = MatchGenre.Groups[1].Value;
|
||||
else
|
||||
@@ -702,8 +689,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchIndex.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found INDEX at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found INDEX at line {0}", line);
|
||||
if (!intrack)
|
||||
throw new FeatureUnsupportedImageException(String.Format("Found INDEX before a track {0}", line));
|
||||
else
|
||||
@@ -720,19 +706,15 @@ namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
cuetracks[currenttrack.sequence - 2].sectors = offset - currentfileoffsetsector;
|
||||
currentfile.offset += cuetracks[currenttrack.sequence - 2].sectors * cuetracks[currenttrack.sequence - 2].bps;
|
||||
////if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Sets currentfile.offset to {0} at line 553", currentfile.offset);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): cuetracks[currenttrack.sequence-2].sectors = {0}", cuetracks[currenttrack.sequence - 2].sectors);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): cuetracks[currenttrack.sequence-2].bps = {0}", cuetracks[currenttrack.sequence - 2].bps);
|
||||
}
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Sets currentfile.offset to {0} at line 553", currentfile.offset);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "cuetracks[currenttrack.sequence-2].sectors = {0}", cuetracks[currenttrack.sequence - 2].sectors);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "cuetracks[currenttrack.sequence-2].bps = {0}", cuetracks[currenttrack.sequence - 2].bps);
|
||||
}
|
||||
}
|
||||
|
||||
if ((index == 0 || (index == 1 && !currenttrack.indexes.ContainsKey(0))) && currenttrack.sequence == 1)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Sets currentfile.offset to {0} at line 559", offset * currenttrack.bps);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Sets currentfile.offset to {0} at line 559", offset * currenttrack.bps);
|
||||
currentfile.offset = offset * currenttrack.bps;
|
||||
}
|
||||
|
||||
@@ -742,16 +724,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchISRC.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found ISRC at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found ISRC at line {0}", line);
|
||||
if (!intrack)
|
||||
throw new FeatureUnsupportedImageException(String.Format("Found ISRC before a track {0}", line));
|
||||
currenttrack.isrc = MatchISRC.Groups[1].Value;
|
||||
}
|
||||
else if (MatchMCN.Success)
|
||||
{
|
||||
////if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found CATALOG at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found CATALOG at line {0}", line);
|
||||
if (!intrack)
|
||||
discimage.mcn = MatchMCN.Groups[1].Value;
|
||||
else
|
||||
@@ -759,8 +739,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchPerformer.Success)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found PERFORMER at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found PERFORMER at line {0}", line);
|
||||
if (intrack)
|
||||
currenttrack.performer = MatchPerformer.Groups[1].Value;
|
||||
else
|
||||
@@ -768,8 +747,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchPostgap.Success)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found POSTGAP at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found POSTGAP at line {0}", line);
|
||||
if (intrack)
|
||||
{
|
||||
currenttrack.postgap = CDRWinMSFToLBA(MatchPostgap.Groups[1].Value);
|
||||
@@ -779,8 +757,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchPregap.Success)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found PREGAP at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found PREGAP at line {0}", line);
|
||||
if (intrack)
|
||||
{
|
||||
currenttrack.pregap = CDRWinMSFToLBA(MatchPregap.Groups[1].Value);
|
||||
@@ -790,8 +767,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchSongWriter.Success)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found SONGWRITER at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found SONGWRITER at line {0}", line);
|
||||
if (intrack)
|
||||
currenttrack.songwriter = MatchSongWriter.Groups[1].Value;
|
||||
else
|
||||
@@ -799,8 +775,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchTitle.Success)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found TITLE at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found TITLE at line {0}", line);
|
||||
if (intrack)
|
||||
currenttrack.title = MatchTitle.Groups[1].Value;
|
||||
else
|
||||
@@ -808,8 +783,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
else if (MatchTrack.Success)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Found TRACK at line {0}", line);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Found TRACK at line {0}", line);
|
||||
if (currentfile.datafile == "")
|
||||
throw new FeatureUnsupportedImageException(String.Format("Found TRACK field before a file is defined at line {0}", line));
|
||||
if (intrack)
|
||||
@@ -825,8 +799,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
currenttrack = new CDRWinTrack();
|
||||
currenttrack.indexes = new Dictionary<int, ulong>();
|
||||
currenttrack.sequence = uint.Parse(MatchTrack.Groups[1].Value);
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Setting currenttrack.sequence to {0}", currenttrack.sequence);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Setting currenttrack.sequence to {0}", currenttrack.sequence);
|
||||
currentfile.sequence = currenttrack.sequence;
|
||||
currenttrack.bps = CDRWinTrackTypeToBytesPerSector(MatchTrack.Groups[2].Value);
|
||||
currenttrack.tracktype = MatchTrack.Groups[2].Value;
|
||||
@@ -946,132 +919,128 @@ namespace DiscImageChef.ImagePlugins
|
||||
discimage.disktype = DiskType.CD;
|
||||
}
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
// DEBUG information
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Disc image parsing results");
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Disc CD-TEXT:");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Disc image parsing results");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Disc CD-TEXT:");
|
||||
if (discimage.arranger == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tArranger is not set.");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tArranger is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tArranger: {0}", discimage.arranger);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tArranger: {0}", discimage.arranger);
|
||||
if (discimage.composer == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tComposer is not set.");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tComposer is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tComposer: {0}", discimage.composer);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tComposer: {0}", discimage.composer);
|
||||
if (discimage.genre == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tGenre is not set.");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tGenre is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tGenre: {0}", discimage.genre);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tGenre: {0}", discimage.genre);
|
||||
if (discimage.performer == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tPerformer is not set.");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tPerformer is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tPerformer: {0}", discimage.performer);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tPerformer: {0}", discimage.performer);
|
||||
if (discimage.songwriter == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tSongwriter is not set.");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tSongwriter is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tSongwriter: {0}", discimage.songwriter);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tSongwriter: {0}", discimage.songwriter);
|
||||
if (discimage.title == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tTitle is not set.");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tTitle is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tTitle: {0}", discimage.title);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tTitle: {0}", discimage.title);
|
||||
if (discimage.cdtextfile == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tCD-TEXT binary file not set.");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tCD-TEXT binary file not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tCD-TEXT binary file: {0}", discimage.cdtextfile);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Disc information:");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tCD-TEXT binary file: {0}", discimage.cdtextfile);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Disc information:");
|
||||
if (discimage.disktypestr == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tISOBuster disc type not set.");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tISOBuster disc type not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tISOBuster disc type: {0}", discimage.disktypestr);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tGuessed disk type: {0}", discimage.disktype);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tISOBuster disc type: {0}", discimage.disktypestr);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tGuessed disk type: {0}", discimage.disktype);
|
||||
if (discimage.barcode == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tBarcode not set.");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tBarcode not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tBarcode: {0}", discimage.barcode);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tBarcode: {0}", discimage.barcode);
|
||||
if (discimage.disk_id == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tDisc ID not set.");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tDisc ID not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tDisc ID: {0}", discimage.disk_id);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tDisc ID: {0}", discimage.disk_id);
|
||||
if (discimage.mcn == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tMCN not set.");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tMCN not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tMCN: {0}", discimage.mcn);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tMCN: {0}", discimage.mcn);
|
||||
if (discimage.comment == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tComment not set.");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tComment not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tComment: \"{0}\"", discimage.comment);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Session information:");
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tDisc contains {0} sessions", discimage.sessions.Count);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tComment: \"{0}\"", discimage.comment);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Session information:");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tDisc contains {0} sessions", discimage.sessions.Count);
|
||||
for (int i = 0; i < discimage.sessions.Count; i++)
|
||||
{
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tSession {0} information:", i + 1);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tStarting track: {0}", discimage.sessions[i].StartTrack);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tStarting sector: {0}", discimage.sessions[i].StartSector);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tEnding track: {0}", discimage.sessions[i].EndTrack);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tEnding sector: {0}", discimage.sessions[i].EndSector);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tSession {0} information:", i + 1);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tStarting track: {0}", discimage.sessions[i].StartTrack);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tStarting sector: {0}", discimage.sessions[i].StartSector);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tEnding track: {0}", discimage.sessions[i].EndTrack);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tEnding sector: {0}", discimage.sessions[i].EndSector);
|
||||
}
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Track information:");
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tDisc contains {0} tracks", discimage.tracks.Count);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Track information:");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tDisc contains {0} tracks", discimage.tracks.Count);
|
||||
for (int i = 0; i < discimage.tracks.Count; i++)
|
||||
{
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tTrack {0} information:", discimage.tracks[i].sequence);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tTrack {0} information:", discimage.tracks[i].sequence);
|
||||
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\t{0} bytes per sector", discimage.tracks[i].bps);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tPregap: {0} sectors", discimage.tracks[i].pregap);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tData: {0} sectors", discimage.tracks[i].sectors);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tPostgap: {0} sectors", discimage.tracks[i].postgap);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\t{0} bytes per sector", discimage.tracks[i].bps);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tPregap: {0} sectors", discimage.tracks[i].pregap);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tData: {0} sectors", discimage.tracks[i].sectors);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tPostgap: {0} sectors", discimage.tracks[i].postgap);
|
||||
|
||||
if (discimage.tracks[i].flag_4ch)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tTrack is flagged as quadraphonic");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tTrack is flagged as quadraphonic");
|
||||
if (discimage.tracks[i].flag_dcp)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tTrack allows digital copy");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tTrack allows digital copy");
|
||||
if (discimage.tracks[i].flag_pre)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tTrack has pre-emphasis applied");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tTrack has pre-emphasis applied");
|
||||
if (discimage.tracks[i].flag_scms)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tTrack has SCMS");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tTrack has SCMS");
|
||||
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tTrack resides in file {0}, type defined as {1}, starting at byte {2}",
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tTrack resides in file {0}, type defined as {1}, starting at byte {2}",
|
||||
discimage.tracks[i].trackfile.datafile, discimage.tracks[i].trackfile.filetype, discimage.tracks[i].trackfile.offset);
|
||||
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tIndexes:");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tIndexes:");
|
||||
foreach (KeyValuePair<int, ulong> kvp in discimage.tracks[i].indexes)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\t\tIndex {0} starts at sector {1}", kvp.Key, kvp.Value);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\t\tIndex {0} starts at sector {1}", kvp.Key, kvp.Value);
|
||||
|
||||
if (discimage.tracks[i].isrc == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tISRC is not set.");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tISRC is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tISRC: {0}", discimage.tracks[i].isrc);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tISRC: {0}", discimage.tracks[i].isrc);
|
||||
|
||||
if (discimage.tracks[i].arranger == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tArranger is not set.");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tArranger is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tArranger: {0}", discimage.tracks[i].arranger);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tArranger: {0}", discimage.tracks[i].arranger);
|
||||
if (discimage.tracks[i].composer == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tComposer is not set.");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tComposer is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tComposer: {0}", discimage.tracks[i].composer);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tComposer: {0}", discimage.tracks[i].composer);
|
||||
if (discimage.tracks[i].genre == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tGenre is not set.");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tGenre is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tGenre: {0}", discimage.tracks[i].genre);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tGenre: {0}", discimage.tracks[i].genre);
|
||||
if (discimage.tracks[i].performer == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tPerformer is not set.");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tPerformer is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tPerformer: {0}", discimage.tracks[i].performer);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tPerformer: {0}", discimage.tracks[i].performer);
|
||||
if (discimage.tracks[i].songwriter == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tSongwriter is not set.");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tSongwriter is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tSongwriter: {0}", discimage.tracks[i].songwriter);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tSongwriter: {0}", discimage.tracks[i].songwriter);
|
||||
if (discimage.tracks[i].title == null)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tTitle is not set.");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tTitle is not set.");
|
||||
else
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \t\tTitle: {0}", discimage.tracks[i].title);
|
||||
}
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\t\tTitle: {0}", discimage.tracks[i].title);
|
||||
}
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Building offset map");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Building offset map");
|
||||
|
||||
partitions = new List<CommonTypes.Partition>();
|
||||
|
||||
@@ -1195,20 +1164,17 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
|
||||
// Print offset map
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (CDRWin plugin) printing partition map");
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "printing partition map");
|
||||
foreach (CommonTypes.Partition partition in partitions)
|
||||
{
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): Partition sequence: {0}", partition.PartitionSequence);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tPartition name: {0}", partition.PartitionName);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tPartition description: {0}", partition.PartitionDescription);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tPartition type: {0}", partition.PartitionType);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tPartition starting sector: {0}", partition.PartitionStartSector);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tPartition sectors: {0}", partition.PartitionSectors);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tPartition starting offset: {0}", partition.PartitionStart);
|
||||
Console.WriteLine("DEBUG (CDRWin plugin): \tPartition size in bytes: {0}", partition.PartitionLength);
|
||||
}
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "Partition sequence: {0}", partition.PartitionSequence);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tPartition name: {0}", partition.PartitionName);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tPartition description: {0}", partition.PartitionDescription);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tPartition type: {0}", partition.PartitionType);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tPartition starting sector: {0}", partition.PartitionStartSector);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tPartition sectors: {0}", partition.PartitionSectors);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tPartition starting offset: {0}", partition.PartitionStart);
|
||||
DicConsole.DebugWriteLine("CDRWin plugin", "\tPartition size in bytes: {0}", partition.PartitionLength);
|
||||
}
|
||||
|
||||
foreach (CDRWinTrack track in discimage.tracks)
|
||||
@@ -1313,9 +1279,9 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Exception trying to identify image file {0}", imagePath);
|
||||
Console.WriteLine("Exception: {0}", ex.Message);
|
||||
Console.WriteLine("Stack trace: {0}", ex.StackTrace);
|
||||
DicConsole.ErrorWriteLine("Exception trying to identify image file {0}", imagePath);
|
||||
DicConsole.ErrorWriteLine("Exception: {0}", ex.Message);
|
||||
DicConsole.ErrorWriteLine("Stack trace: {0}", ex.StackTrace);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,15 @@
|
||||
2015-10-18 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* VHD.cs:
|
||||
* Nero.cs:
|
||||
* CDRWin.cs:
|
||||
* Apple2MG.cs:
|
||||
* TeleDisk.cs:
|
||||
* DiskCopy42.cs:
|
||||
* DiscImageChef.DiscImages.csproj:
|
||||
Added specific console handling for standard, verbose, debug
|
||||
and error outputs.
|
||||
|
||||
2015-10-05 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* VHD.cs:
|
||||
|
||||
@@ -59,5 +59,9 @@
|
||||
<Project>{F8BDF57B-1571-4CD0-84B3-B422088D359A}</Project>
|
||||
<Name>DiscImageChef.Helpers</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\DiscImageChef.Console\DiscImageChef.Console.csproj">
|
||||
<Project>{CCAA7AFE-C094-4D82-A66D-630DE8A3F545}</Project>
|
||||
<Name>DiscImageChef.Console</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -39,6 +39,7 @@ Copyright (C) 2011-2014 Claunia.com
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
@@ -181,18 +182,15 @@ namespace DiscImageChef.ImagePlugins
|
||||
tmp_header.valid = buffer[0x52];
|
||||
tmp_header.reserved = buffer[0x53];
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.diskName = \"{0}\"", tmp_header.diskName);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.dataSize = {0} bytes", tmp_header.dataSize);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.tagSize = {0} bytes", tmp_header.tagSize);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.dataChecksum = 0x{0:X8}", tmp_header.dataChecksum);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.tagChecksum = 0x{0:X8}", tmp_header.tagChecksum);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.format = 0x{0:X2}", tmp_header.format);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.fmtByte = 0x{0:X2}", tmp_header.fmtByte);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.valid = {0}", tmp_header.valid);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): tmp_header.reserved = {0}", tmp_header.reserved);
|
||||
}
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "tmp_header.diskName = \"{0}\"", tmp_header.diskName);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "tmp_header.dataSize = {0} bytes", tmp_header.dataSize);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "tmp_header.tagSize = {0} bytes", tmp_header.tagSize);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "tmp_header.dataChecksum = 0x{0:X8}", tmp_header.dataChecksum);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "tmp_header.tagChecksum = 0x{0:X8}", tmp_header.tagChecksum);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "tmp_header.format = 0x{0:X2}", tmp_header.format);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "tmp_header.fmtByte = 0x{0:X2}", tmp_header.fmtByte);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "tmp_header.valid = {0}", tmp_header.valid);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "tmp_header.reserved = {0}", tmp_header.reserved);
|
||||
|
||||
if (tmp_header.valid != 1 || tmp_header.reserved != 0)
|
||||
return false;
|
||||
@@ -205,8 +203,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
if (tmp_header.format != kSonyFormat400K && tmp_header.format != kSonyFormat800K && tmp_header.format != kSonyFormat720K &&
|
||||
tmp_header.format != kSonyFormat1440K && tmp_header.format != kSonyFormat1680K && tmp_header.format != kSigmaFormatTwiggy)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("Unknown tmp_header.format = 0x{0:X2} value", tmp_header.format);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Unknown tmp_header.format = 0x{0:X2} value", tmp_header.format);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -214,16 +211,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
if (tmp_header.fmtByte != kSonyFmtByte400K && tmp_header.fmtByte != kSonyFmtByte800K && tmp_header.fmtByte != kSonyFmtByte800KIncorrect &&
|
||||
tmp_header.fmtByte != kSonyFmtByteProDos && tmp_header.fmtByte != kInvalidFmtByte && tmp_header.fmtByte != kSigmaFmtByteTwiggy)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("Unknown tmp_header.fmtByte = 0x{0:X2} value", tmp_header.fmtByte);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Unknown tmp_header.fmtByte = 0x{0:X2} value", tmp_header.fmtByte);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (tmp_header.fmtByte == kInvalidFmtByte)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("Image says it's unformatted");
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Image says it's unformatted");
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -258,18 +253,15 @@ namespace DiscImageChef.ImagePlugins
|
||||
header.valid = buffer[0x52];
|
||||
header.reserved = buffer[0x53];
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.diskName = \"{0}\"", header.diskName);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.dataSize = {0} bytes", header.dataSize);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.tagSize = {0} bytes", header.tagSize);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.dataChecksum = 0x{0:X8}", header.dataChecksum);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.tagChecksum = 0x{0:X8}", header.tagChecksum);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.format = 0x{0:X2}", header.format);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.fmtByte = 0x{0:X2}", header.fmtByte);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.valid = {0}", header.valid);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.reserved = {0}", header.reserved);
|
||||
}
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.diskName = \"{0}\"", header.diskName);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.dataSize = {0} bytes", header.dataSize);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.tagSize = {0} bytes", header.tagSize);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.dataChecksum = 0x{0:X8}", header.dataChecksum);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.tagChecksum = 0x{0:X8}", header.tagChecksum);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.format = 0x{0:X2}", header.format);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.fmtByte = 0x{0:X2}", header.fmtByte);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.valid = {0}", header.valid);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.reserved = {0}", header.reserved);
|
||||
|
||||
if (header.valid != 1 || header.reserved != 0)
|
||||
return false;
|
||||
@@ -282,8 +274,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
if (header.format != kSonyFormat400K && header.format != kSonyFormat800K && header.format != kSonyFormat720K &&
|
||||
header.format != kSonyFormat1440K && header.format != kSonyFormat1680K && header.format != kSigmaFormatTwiggy)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Unknown header.format = 0x{0:X2} value", header.format);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Unknown header.format = 0x{0:X2} value", header.format);
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -291,16 +282,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
if (header.fmtByte != kSonyFmtByte400K && header.fmtByte != kSonyFmtByte800K && header.fmtByte != kSonyFmtByte800KIncorrect &&
|
||||
header.fmtByte != kSonyFmtByteProDos && header.fmtByte != kInvalidFmtByte && header.fmtByte != kSigmaFmtByteTwiggy)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Unknown tmp_header.fmtByte = 0x{0:X2} value", header.fmtByte);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Unknown tmp_header.fmtByte = 0x{0:X2} value", header.fmtByte);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if (header.fmtByte == kInvalidFmtByte)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Image says it's unformatted");
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Image says it's unformatted");
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -317,8 +306,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
if (header.tagSize / 12 != ImageInfo.sectors)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (DC42 plugin): header.tagSize / 12 != sectors");
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "header.tagSize / 12 != sectors");
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -398,39 +386,29 @@ namespace DiscImageChef.ImagePlugins
|
||||
UInt32 dataChk;
|
||||
UInt32 tagsChk = 0;
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Reading data");
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Reading data");
|
||||
FileStream datastream = new FileStream(dc42ImagePath, FileMode.Open, FileAccess.Read);
|
||||
datastream.Seek((long)(dataOffset), SeekOrigin.Begin);
|
||||
datastream.Read(data, 0, (int)header.dataSize);
|
||||
datastream.Close();
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Calculating data checksum");
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Calculating data checksum");
|
||||
dataChk = DC42CheckSum(data);
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Calculated data checksum = 0x{0:X8}", dataChk);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Stored data checksum = 0x{0:X8}", header.dataChecksum);
|
||||
}
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Calculated data checksum = 0x{0:X8}", dataChk);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Stored data checksum = 0x{0:X8}", header.dataChecksum);
|
||||
|
||||
if (header.tagSize > 0)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Reading tags");
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Reading tags");
|
||||
FileStream tagstream = new FileStream(dc42ImagePath, FileMode.Open, FileAccess.Read);
|
||||
tagstream.Seek((long)(tagOffset), SeekOrigin.Begin);
|
||||
tagstream.Read(tags, 0, (int)header.tagSize);
|
||||
tagstream.Close();
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Calculating tag checksum");
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Calculating tag checksum");
|
||||
tagsChk = DC42CheckSum(tags);
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Calculated tag checksum = 0x{0:X8}", tagsChk);
|
||||
Console.WriteLine("DEBUG (DC42 plugin): Stored tag checksum = 0x{0:X8}", header.tagChecksum);
|
||||
}
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Calculated tag checksum = 0x{0:X8}", tagsChk);
|
||||
DicConsole.DebugWriteLine("DC42 plugin", "Stored tag checksum = 0x{0:X8}", header.tagChecksum);
|
||||
}
|
||||
|
||||
return dataChk == header.dataChecksum && tagsChk == header.tagChecksum;
|
||||
|
||||
@@ -38,6 +38,7 @@ using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
@@ -900,14 +901,11 @@ namespace DiscImageChef.ImagePlugins
|
||||
footerV2.ChunkID = BigEndianBitConverter.ToUInt32(buffer, 0);
|
||||
footerV2.FirstChunkOffset = BigEndianBitConverter.ToUInt64(buffer, 4);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): imageInfo.Length = {0}", imageInfo.Length);
|
||||
Console.WriteLine("DEBUG (Nero plugin): footerV1.ChunkID = 0x{0:X2} (\"{1}\")", footerV1.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV1.ChunkID)));
|
||||
Console.WriteLine("DEBUG (Nero plugin): footerV1.FirstChunkOffset = {0}", footerV1.FirstChunkOffset);
|
||||
Console.WriteLine("DEBUG (Nero plugin): footerV2.ChunkID = 0x{0:X2} (\"{1}\")", footerV2.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV2.ChunkID)));
|
||||
Console.WriteLine("DEBUG (Nero plugin): footerV2.FirstChunkOffset = {0}", footerV2.FirstChunkOffset);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "imageInfo.Length = {0}", imageInfo.Length);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "footerV1.ChunkID = 0x{0:X2} (\"{1}\")", footerV1.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV1.ChunkID)));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "footerV1.FirstChunkOffset = {0}", footerV1.FirstChunkOffset);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "footerV2.ChunkID = 0x{0:X2} (\"{1}\")", footerV2.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV2.ChunkID)));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "footerV2.FirstChunkOffset = {0}", footerV2.FirstChunkOffset);
|
||||
|
||||
if (footerV2.ChunkID == NeroV2FooterID && footerV2.FirstChunkOffset < (ulong)imageInfo.Length)
|
||||
{
|
||||
@@ -948,14 +946,11 @@ namespace DiscImageChef.ImagePlugins
|
||||
footerV2.ChunkID = BigEndianBitConverter.ToUInt32(buffer, 0);
|
||||
footerV2.FirstChunkOffset = BigEndianBitConverter.ToUInt64(buffer, 4);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): imageInfo.Length = {0}", imageInfo.Length);
|
||||
Console.WriteLine("DEBUG (Nero plugin): footerV1.ChunkID = 0x{0:X2} (\"{1}\")", footerV1.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV1.ChunkID)));
|
||||
Console.WriteLine("DEBUG (Nero plugin): footerV1.FirstChunkOffset = {0}", footerV1.FirstChunkOffset);
|
||||
Console.WriteLine("DEBUG (Nero plugin): footerV2.ChunkID = 0x{0:X2} (\"{1}\")", footerV2.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV2.ChunkID)));
|
||||
Console.WriteLine("DEBUG (Nero plugin): footerV2.FirstChunkOffset = {0}", footerV2.FirstChunkOffset);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "imageInfo.Length = {0}", imageInfo.Length);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "footerV1.ChunkID = 0x{0:X2} (\"{1}\")", footerV1.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV1.ChunkID)));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "footerV1.FirstChunkOffset = {0}", footerV1.FirstChunkOffset);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "footerV2.ChunkID = 0x{0:X2} (\"{1}\")", footerV2.ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(footerV2.ChunkID)));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "footerV2.FirstChunkOffset = {0}", footerV2.FirstChunkOffset);
|
||||
|
||||
if (footerV1.ChunkID == NeroV1FooterID && footerV1.FirstChunkOffset < (ulong)imageInfo.Length)
|
||||
imageNewFormat = false;
|
||||
@@ -993,18 +988,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
ChunkID = BigEndianBitConverter.ToUInt32(ChunkHeaderBuffer, 0);
|
||||
ChunkLength = BigEndianBitConverter.ToUInt32(ChunkHeaderBuffer, 4);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): ChunkID = 0x{0:X2} (\"{1}\")", ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(ChunkID)));
|
||||
Console.WriteLine("DEBUG (Nero plugin): ChunkLength = {0}", ChunkLength);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "ChunkID = 0x{0:X2} (\"{1}\")", ChunkID, System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(ChunkID)));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "ChunkLength = {0}", ChunkLength);
|
||||
|
||||
switch (ChunkID)
|
||||
{
|
||||
case NeroV1CUEID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"CUES\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"CUES\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroCuesheetV1 = new NeroV1Cuesheet();
|
||||
neroCuesheetV1.ChunkID = ChunkID;
|
||||
@@ -1024,17 +1015,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
_entry.Second = tmpbuffer[6];
|
||||
_entry.Frame = tmpbuffer[7];
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): Cuesheet entry {0}", (i / 8) + 1);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Mode = {1:X2}", (i / 8) + 1, _entry.Mode);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].TrackNumber = {1:X2}", (i / 8) + 1, _entry.TrackNumber);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].IndexNumber = {1:X2}", (i / 8) + 1, _entry.IndexNumber);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Dummy = {1:X4}", (i / 8) + 1, _entry.Dummy);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Minute = {1:X2}", (i / 8) + 1, _entry.Minute);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Second = {1:X2}", (i / 8) + 1, _entry.Second);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Frame = {1:X2}", (i / 8) + 1, _entry.Frame);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Cuesheet entry {0}", (i / 8) + 1);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Mode = {1:X2}", (i / 8) + 1, _entry.Mode);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].TrackNumber = {1:X2}", (i / 8) + 1, _entry.TrackNumber);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].IndexNumber = {1:X2}", (i / 8) + 1, _entry.IndexNumber);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Dummy = {1:X4}", (i / 8) + 1, _entry.Dummy);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Minute = {1:X2}", (i / 8) + 1, _entry.Minute);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Second = {1:X2}", (i / 8) + 1, _entry.Second);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Frame = {1:X2}", (i / 8) + 1, _entry.Frame);
|
||||
|
||||
neroCuesheetV1.Entries.Add(_entry);
|
||||
}
|
||||
@@ -1043,8 +1031,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
case NeroV2CUEID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"CUEX\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"CUEX\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroCuesheetV2 = new NeroV2Cuesheet();
|
||||
neroCuesheetV2.ChunkID = ChunkID;
|
||||
@@ -1062,15 +1049,12 @@ namespace DiscImageChef.ImagePlugins
|
||||
_entry.Dummy = tmpbuffer[3];
|
||||
_entry.LBAStart = BigEndianBitConverter.ToInt32(tmpbuffer, 4);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): Cuesheet entry {0}", (i / 8) + 1);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Mode = 0x{1:X2}", (i / 8) + 1, _entry.Mode);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].TrackNumber = {1:X2}", (i / 8) + 1, _entry.TrackNumber);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].IndexNumber = {1:X2}", (i / 8) + 1, _entry.IndexNumber);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Dummy = {1:X2}", (i / 8) + 1, _entry.Dummy);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].LBAStart = {1}", (i / 8) + 1, _entry.LBAStart);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Cuesheet entry {0}", (i / 8) + 1);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Mode = 0x{1:X2}", (i / 8) + 1, _entry.Mode);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].TrackNumber = {1:X2}", (i / 8) + 1, _entry.TrackNumber);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].IndexNumber = {1:X2}", (i / 8) + 1, _entry.IndexNumber);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Dummy = {1:X2}", (i / 8) + 1, _entry.Dummy);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].LBAStart = {1}", (i / 8) + 1, _entry.LBAStart);
|
||||
|
||||
neroCuesheetV2.Entries.Add(_entry);
|
||||
}
|
||||
@@ -1079,8 +1063,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
case NeroV1DAOID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"DAOI\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"DAOI\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroDAOV1 = new NeroV1DAO();
|
||||
neroDAOV1.ChunkID = ChunkID;
|
||||
@@ -1102,14 +1085,11 @@ namespace DiscImageChef.ImagePlugins
|
||||
if (!ImageInfo.readableSectorTags.Contains(SectorTagType.CDTrackISRC))
|
||||
ImageInfo.readableSectorTags.Add(SectorTagType.CDTrackISRC);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV1.ChunkSizeLe = {0} bytes", neroDAOV1.ChunkSizeLe);
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV1.UPC = \"{0}\"", StringHandlers.CToString(neroDAOV1.UPC));
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV1.TocType = 0x{0:X4}", neroDAOV1.TocType);
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV1.FirstTrack = {0}", neroDAOV1.FirstTrack);
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV1.LastTrack = {0}", neroDAOV1.LastTrack);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV1.ChunkSizeLe = {0} bytes", neroDAOV1.ChunkSizeLe);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV1.UPC = \"{0}\"", StringHandlers.CToString(neroDAOV1.UPC));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV1.TocType = 0x{0:X4}", neroDAOV1.TocType);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV1.FirstTrack = {0}", neroDAOV1.FirstTrack);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV1.LastTrack = {0}", neroDAOV1.LastTrack);
|
||||
|
||||
UPC = neroDAOV1.UPC;
|
||||
|
||||
@@ -1127,17 +1107,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
_entry.Index1 = BigEndianBitConverter.ToUInt32(tmpbuffer, 22);
|
||||
_entry.EndOfTrack = BigEndianBitConverter.ToUInt32(tmpbuffer, 26);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): Disc-At-Once entry {0}", (i / 32) + 1);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].ISRC = \"{1}\"", (i / 32) + 1, StringHandlers.CToString(_entry.ISRC));
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].SectorSize = {1}", (i / 32) + 1, _entry.SectorSize);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Mode = {1} (0x{2:X4})", (i / 32) + 1, (DAOMode)_entry.Mode, _entry.Mode);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Unknown = 0x{1:X4}", (i / 32) + 1, _entry.Unknown);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Index0 = {1}", (i / 32) + 1, _entry.Index0);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Index1 = {1}", (i / 32) + 1, _entry.Index1);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].EndOfTrack = {1}", (i / 32) + 1, _entry.EndOfTrack);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Disc-At-Once entry {0}", (i / 32) + 1);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].ISRC = \"{1}\"", (i / 32) + 1, StringHandlers.CToString(_entry.ISRC));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].SectorSize = {1}", (i / 32) + 1, _entry.SectorSize);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Mode = {1} (0x{2:X4})", (i / 32) + 1, (DAOMode)_entry.Mode, _entry.Mode);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Unknown = 0x{1:X4}", (i / 32) + 1, _entry.Unknown);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Index0 = {1}", (i / 32) + 1, _entry.Index0);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Index1 = {1}", (i / 32) + 1, _entry.Index1);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].EndOfTrack = {1}", (i / 32) + 1, _entry.EndOfTrack);
|
||||
|
||||
neroDAOV1.Tracks.Add(_entry);
|
||||
|
||||
@@ -1169,8 +1146,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
case NeroV2DAOID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"DAOX\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"DAOX\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroDAOV2 = new NeroV2DAO();
|
||||
neroDAOV2.ChunkID = ChunkID;
|
||||
@@ -1194,14 +1170,11 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
UPC = neroDAOV2.UPC;
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV2.ChunkSizeLe = {0} bytes", neroDAOV2.ChunkSizeLe);
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV2.UPC = \"{0}\"", StringHandlers.CToString(neroDAOV2.UPC));
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV2.TocType = 0x{0:X4}", neroDAOV2.TocType);
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV2.FirstTrack = {0}", neroDAOV2.FirstTrack);
|
||||
Console.WriteLine("DEBUG (Nero plugin): neroDAOV2.LastTrack = {0}", neroDAOV2.LastTrack);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV2.ChunkSizeLe = {0} bytes", neroDAOV2.ChunkSizeLe);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV2.UPC = \"{0}\"", StringHandlers.CToString(neroDAOV2.UPC));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV2.TocType = 0x{0:X4}", neroDAOV2.TocType);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV2.FirstTrack = {0}", neroDAOV2.FirstTrack);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "neroDAOV2.LastTrack = {0}", neroDAOV2.LastTrack);
|
||||
|
||||
tmpbuffer = new byte[42];
|
||||
for (int i = 0; i < (neroDAOV2.ChunkSizeBe - 22); i += 42)
|
||||
@@ -1217,17 +1190,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
_entry.Index1 = BigEndianBitConverter.ToUInt64(tmpbuffer, 26);
|
||||
_entry.EndOfTrack = BigEndianBitConverter.ToUInt64(tmpbuffer, 34);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): Disc-At-Once entry {0}", (i / 32) + 1);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].ISRC = \"{1}\"", (i / 32) + 1, StringHandlers.CToString(_entry.ISRC));
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].SectorSize = {1}", (i / 32) + 1, _entry.SectorSize);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Mode = {1} (0x{2:X4})", (i / 32) + 1, (DAOMode)_entry.Mode, _entry.Mode);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Unknown = {1:X2}", (i / 32) + 1, _entry.Unknown);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Index0 = {1}", (i / 32) + 1, _entry.Index0);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Index1 = {1}", (i / 32) + 1, _entry.Index1);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].EndOfTrack = {1}", (i / 32) + 1, _entry.EndOfTrack);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Disc-At-Once entry {0}", (i / 32) + 1);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].ISRC = \"{1}\"", (i / 32) + 1, StringHandlers.CToString(_entry.ISRC));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].SectorSize = {1}", (i / 32) + 1, _entry.SectorSize);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Mode = {1} (0x{2:X4})", (i / 32) + 1, (DAOMode)_entry.Mode, _entry.Mode);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Unknown = {1:X2}", (i / 32) + 1, _entry.Unknown);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Index0 = {1}", (i / 32) + 1, _entry.Index0);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Index1 = {1}", (i / 32) + 1, _entry.Index1);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].EndOfTrack = {1}", (i / 32) + 1, _entry.EndOfTrack);
|
||||
|
||||
neroDAOV2.Tracks.Add(_entry);
|
||||
|
||||
@@ -1259,8 +1229,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
case NeroCDTextID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"CDTX\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"CDTX\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroCDTXT = new NeroCDText();
|
||||
neroCDTXT.ChunkID = ChunkID;
|
||||
@@ -1281,16 +1250,13 @@ namespace DiscImageChef.ImagePlugins
|
||||
Array.Copy(tmpbuffer, 4, _entry.Text, 0, 12);
|
||||
_entry.CRC = BigEndianBitConverter.ToUInt16(tmpbuffer, 16);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): CD-TEXT entry {0}", (i / 18) + 1);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].PackType = 0x{1:X2}", (i / 18) + 1, _entry.PackType);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].TrackNumber = 0x{1:X2}", (i / 18) + 1, _entry.TrackNumber);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].PackNumber = 0x{1:X2}", (i / 18) + 1, _entry.PackNumber);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].BlockNumber = 0x{1:X2}", (i / 18) + 1, _entry.BlockNumber);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Text = \"{1}\"", (i / 18) + 1, StringHandlers.CToString(_entry.Text));
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].CRC = 0x{1:X4}", (i / 18) + 1, _entry.CRC);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "CD-TEXT entry {0}", (i / 18) + 1);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].PackType = 0x{1:X2}", (i / 18) + 1, _entry.PackType);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].TrackNumber = 0x{1:X2}", (i / 18) + 1, _entry.TrackNumber);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].PackNumber = 0x{1:X2}", (i / 18) + 1, _entry.PackNumber);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].BlockNumber = 0x{1:X2}", (i / 18) + 1, _entry.BlockNumber);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Text = \"{1}\"", (i / 18) + 1, StringHandlers.CToString(_entry.Text));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].CRC = 0x{1:X4}", (i / 18) + 1, _entry.CRC);
|
||||
|
||||
neroCDTXT.Packs.Add(_entry);
|
||||
}
|
||||
@@ -1299,8 +1265,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
case NeroV1TAOID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"ETNF\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"ETNF\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroTAOV1 = new NeroV1TAO();
|
||||
neroTAOV1.ChunkID = ChunkID;
|
||||
@@ -1319,15 +1284,12 @@ namespace DiscImageChef.ImagePlugins
|
||||
_entry.StartLBA = BigEndianBitConverter.ToUInt32(tmpbuffer, 12);
|
||||
_entry.Unknown = BigEndianBitConverter.ToUInt32(tmpbuffer, 16);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): Track-at-Once entry {0}", (i / 20) + 1);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Offset = {1}", (i / 20) + 1, _entry.Offset);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Length = {1} bytes", (i / 20) + 1, _entry.Length);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Mode = {1} (0x{2:X4})", (i / 20) + 1, (DAOMode)_entry.Mode, _entry.Mode);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].StartLBA = {1}", (i / 20) + 1, _entry.StartLBA);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Unknown = 0x{1:X4}", (i / 20) + 1, _entry.Unknown);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Track-at-Once entry {0}", (i / 20) + 1);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Offset = {1}", (i / 20) + 1, _entry.Offset);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Length = {1} bytes", (i / 20) + 1, _entry.Length);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Mode = {1} (0x{2:X4})", (i / 20) + 1, (DAOMode)_entry.Mode, _entry.Mode);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].StartLBA = {1}", (i / 20) + 1, _entry.StartLBA);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Unknown = 0x{1:X4}", (i / 20) + 1, _entry.Unknown);
|
||||
|
||||
neroTAOV1.Tracks.Add(_entry);
|
||||
|
||||
@@ -1357,8 +1319,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
case NeroV2TAOID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"ETN2\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"ETN2\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroTAOV2 = new NeroV2TAO();
|
||||
neroTAOV2.ChunkID = ChunkID;
|
||||
@@ -1378,16 +1339,13 @@ namespace DiscImageChef.ImagePlugins
|
||||
_entry.Unknown = BigEndianBitConverter.ToUInt32(tmpbuffer, 24);
|
||||
_entry.Sectors = BigEndianBitConverter.ToUInt32(tmpbuffer, 28);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): Track-at-Once entry {0}", (i / 32) + 1);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Offset = {1}", (i / 32) + 1, _entry.Offset);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Length = {1} bytes", (i / 32) + 1, _entry.Length);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Mode = {1} (0x{2:X4})", (i / 32) + 1, (DAOMode)_entry.Mode, _entry.Mode);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].StartLBA = {1}", (i / 32) + 1, _entry.StartLBA);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Unknown = 0x{1:X4}", (i / 32) + 1, _entry.Unknown);
|
||||
Console.WriteLine("DEBUG (Nero plugin):\t _entry[{0}].Sectors = {1}", (i / 32) + 1, _entry.Sectors);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Track-at-Once entry {0}", (i / 32) + 1);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Offset = {1}", (i / 32) + 1, _entry.Offset);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Length = {1} bytes", (i / 32) + 1, _entry.Length);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Mode = {1} (0x{2:X4})", (i / 32) + 1, (DAOMode)_entry.Mode, _entry.Mode);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].StartLBA = {1}", (i / 32) + 1, _entry.StartLBA);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Unknown = 0x{1:X4}", (i / 32) + 1, _entry.Unknown);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t _entry[{0}].Sectors = {1}", (i / 32) + 1, _entry.Sectors);
|
||||
|
||||
neroTAOV2.Tracks.Add(_entry);
|
||||
|
||||
@@ -1417,8 +1375,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
case NeroSessionID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"SINF\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"SINF\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
UInt32 sessionTracks;
|
||||
byte[] tmpbuffer = new byte[4];
|
||||
@@ -1426,16 +1383,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
sessionTracks = BigEndianBitConverter.ToUInt32(tmpbuffer, 0);
|
||||
neroSessions.Add(currentsession, sessionTracks);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): \tSession {0} has {1} tracks", currentsession, sessionTracks);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\tSession {0} has {1} tracks", currentsession, sessionTracks);
|
||||
|
||||
currentsession++;
|
||||
break;
|
||||
}
|
||||
case NeroDiskTypeID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"MTYP\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"MTYP\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroMediaTyp = new NeroMediaType();
|
||||
|
||||
@@ -1446,8 +1401,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
imageStream.Read(tmpbuffer, 0, 4);
|
||||
neroMediaTyp.Type = BigEndianBitConverter.ToUInt32(tmpbuffer, 0);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): \tMedia type is {0} ({1})", (NeroMediaTypes)neroMediaTyp.Type, neroMediaTyp.Type);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\tMedia type is {0} ({1})", (NeroMediaTypes)neroMediaTyp.Type, neroMediaTyp.Type);
|
||||
|
||||
ImageInfo.diskType = NeroMediaTypeToDiskType((NeroMediaTypes)neroMediaTyp.Type);
|
||||
|
||||
@@ -1455,8 +1409,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
case NeroDiscInfoID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"DINF\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"DINF\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroDiscInfo = new NeroDiscInformation();
|
||||
neroDiscInfo.ChunkID = ChunkID;
|
||||
@@ -1465,15 +1418,13 @@ namespace DiscImageChef.ImagePlugins
|
||||
imageStream.Read(tmpbuffer, 0, 4);
|
||||
neroDiscInfo.Unknown = BigEndianBitConverter.ToUInt32(tmpbuffer, 0);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): \tneroDiscInfo.Unknown = 0x{0:X4} ({0})", neroDiscInfo.Unknown);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\tneroDiscInfo.Unknown = 0x{0:X4} ({0})", neroDiscInfo.Unknown);
|
||||
|
||||
break;
|
||||
}
|
||||
case NeroReloID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"RELO\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"RELO\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroRELO = new NeroRELOChunk();
|
||||
neroRELO.ChunkID = ChunkID;
|
||||
@@ -1482,15 +1433,13 @@ namespace DiscImageChef.ImagePlugins
|
||||
imageStream.Read(tmpbuffer, 0, 4);
|
||||
neroRELO.Unknown = BigEndianBitConverter.ToUInt32(tmpbuffer, 0);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): \tneroRELO.Unknown = 0x{0:X4} ({0})", neroRELO.Unknown);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\tneroRELO.Unknown = 0x{0:X4} ({0})", neroRELO.Unknown);
|
||||
|
||||
break;
|
||||
}
|
||||
case NeroTOCID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"TOCT\" chunk, parsing {0} bytes", ChunkLength);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"TOCT\" chunk, parsing {0} bytes", ChunkLength);
|
||||
|
||||
neroTOC = new NeroTOCChunk();
|
||||
neroTOC.ChunkID = ChunkID;
|
||||
@@ -1499,22 +1448,19 @@ namespace DiscImageChef.ImagePlugins
|
||||
imageStream.Read(tmpbuffer, 0, 2);
|
||||
neroTOC.Unknown = BigEndianBitConverter.ToUInt16(tmpbuffer, 0);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): \tneroTOC.Unknown = 0x{0:X4} ({0})", neroTOC.Unknown);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\tneroTOC.Unknown = 0x{0:X4} ({0})", neroTOC.Unknown);
|
||||
|
||||
break;
|
||||
}
|
||||
case NeroEndID:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Found \"END!\" chunk, finishing parse");
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Found \"END!\" chunk, finishing parse");
|
||||
parsing = false;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Unknown chunk ID \"{0}\", skipping...", System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(ChunkID)));
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Unknown chunk ID \"{0}\", skipping...", System.Text.Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(ChunkID)));
|
||||
imageStream.Seek(ChunkLength, SeekOrigin.Current);
|
||||
break;
|
||||
}
|
||||
@@ -1556,8 +1502,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
if (neroSessions.Count == 0)
|
||||
neroSessions.Add(1, currenttrack);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): Building offset, track and session maps");
|
||||
DicConsole.DebugWriteLine("Nero plugin", "Building offset, track and session maps");
|
||||
|
||||
currentsession = 1;
|
||||
uint currentsessionmaxtrack;
|
||||
@@ -1570,12 +1515,9 @@ namespace DiscImageChef.ImagePlugins
|
||||
NeroTrack _neroTrack;
|
||||
if (neroTracks.TryGetValue(i, out _neroTrack))
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): \tcurrentsession = {0}", currentsession);
|
||||
Console.WriteLine("DEBUG (Nero plugin): \tcurrentsessionmaxtrack = {0}", currentsessionmaxtrack);
|
||||
Console.WriteLine("DEBUG (Nero plugin): \tcurrentsessioncurrenttrack = {0}", currentsessioncurrenttrack);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\tcurrentsession = {0}", currentsession);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\tcurrentsessionmaxtrack = {0}", currentsessionmaxtrack);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\tcurrentsessioncurrenttrack = {0}", currentsessioncurrenttrack);
|
||||
|
||||
Track _track = new Track();
|
||||
_track.Indexes = new Dictionary<int, ulong>();
|
||||
@@ -1591,16 +1533,13 @@ namespace DiscImageChef.ImagePlugins
|
||||
_track.TrackType = NeroTrackModeToTrackType((DAOMode)_neroTrack.Mode);
|
||||
imageTracks.Add(_track);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Nero plugin): \t\t _track.TrackDescription = {0}", _track.TrackDescription);
|
||||
Console.WriteLine("DEBUG (Nero plugin): \t\t _track.TrackEndSector = {0}", _track.TrackEndSector);
|
||||
Console.WriteLine("DEBUG (Nero plugin): \t\t _track.TrackPregap = {0}", _track.TrackPregap);
|
||||
Console.WriteLine("DEBUG (Nero plugin): \t\t _track.TrackSequence = {0}", _track.TrackSequence);
|
||||
Console.WriteLine("DEBUG (Nero plugin): \t\t _track.TrackSession = {0}", _track.TrackSession);
|
||||
Console.WriteLine("DEBUG (Nero plugin): \t\t _track.TrackStartSector = {0}", _track.TrackStartSector);
|
||||
Console.WriteLine("DEBUG (Nero plugin): \t\t _track.TrackType = {0}", _track.TrackType);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t _track.TrackDescription = {0}", _track.TrackDescription);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t _track.TrackEndSector = {0}", _track.TrackEndSector);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t _track.TrackPregap = {0}", _track.TrackPregap);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t _track.TrackSequence = {0}", _track.TrackSequence);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t _track.TrackSession = {0}", _track.TrackSession);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t _track.TrackStartSector = {0}", _track.TrackStartSector);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t _track.TrackType = {0}", _track.TrackType);
|
||||
|
||||
if (currentsessioncurrenttrack == 1)
|
||||
{
|
||||
@@ -1621,8 +1560,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
|
||||
offsetmap.Add(_track.TrackSequence, _track.TrackStartSector);
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Nero plugin): \t\t Offset[{0}]: {1}", _track.TrackSequence, _track.TrackStartSector);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t Offset[{0}]: {1}", _track.TrackSequence, _track.TrackStartSector);
|
||||
|
||||
CommonTypes.Partition partition;
|
||||
|
||||
|
||||
@@ -42,6 +42,9 @@ using System.Collections.Generic;
|
||||
|
||||
// Created following notes from Dave Dunfield
|
||||
// http://www.classiccmp.org/dunfield/img54306/td0notes.txt
|
||||
using DiscImageChef.Console;
|
||||
|
||||
|
||||
namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
class TeleDisk : ImagePlugin
|
||||
@@ -255,20 +258,17 @@ namespace DiscImageChef.ImagePlugins
|
||||
Array.Copy(headerBytes, headerBytesForCRC, 10);
|
||||
UInt16 calculatedHeaderCRC = TeleDiskCRC(0x0000, headerBytesForCRC);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.signature = 0x{0:X4}", header.signature);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.sequence = 0x{0:X2}", header.sequence);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.diskSet = 0x{0:X2}", header.diskSet);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.version = 0x{0:X2}", header.version);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.dataRate = 0x{0:X2}", header.dataRate);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.driveType = 0x{0:X2}", header.driveType);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.stepping = 0x{0:X2}", header.stepping);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.dosAllocation = 0x{0:X2}", header.dosAllocation);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.sides = 0x{0:X2}", header.sides);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.crc = 0x{0:X4}", header.crc);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): calculated header crc = 0x{0:X4}", calculatedHeaderCRC);
|
||||
}
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.signature = 0x{0:X4}", header.signature);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.sequence = 0x{0:X2}", header.sequence);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.diskSet = 0x{0:X2}", header.diskSet);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.version = 0x{0:X2}", header.version);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.dataRate = 0x{0:X2}", header.dataRate);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.driveType = 0x{0:X2}", header.driveType);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.stepping = 0x{0:X2}", header.stepping);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.dosAllocation = 0x{0:X2}", header.dosAllocation);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.sides = 0x{0:X2}", header.sides);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.crc = 0x{0:X4}", header.crc);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "calculated header crc = 0x{0:X4}", calculatedHeaderCRC);
|
||||
|
||||
// We need more checks as the magic is too simply.
|
||||
// This may deny legal images
|
||||
@@ -321,20 +321,17 @@ namespace DiscImageChef.ImagePlugins
|
||||
Array.Copy(headerBytes, headerBytesForCRC, 10);
|
||||
UInt16 calculatedHeaderCRC = TeleDiskCRC(0x0000, headerBytesForCRC);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.signature = 0x{0:X4}", header.signature);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.sequence = 0x{0:X2}", header.sequence);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.diskSet = 0x{0:X2}", header.diskSet);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.version = 0x{0:X2}", header.version);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.dataRate = 0x{0:X2}", header.dataRate);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.driveType = 0x{0:X2}", header.driveType);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.stepping = 0x{0:X2}", header.stepping);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.dosAllocation = 0x{0:X2}", header.dosAllocation);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.sides = 0x{0:X2}", header.sides);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): header.crc = 0x{0:X4}", header.crc);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): calculated header crc = 0x{0:X4}", calculatedHeaderCRC);
|
||||
}
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.signature = 0x{0:X4}", header.signature);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.sequence = 0x{0:X2}", header.sequence);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.diskSet = 0x{0:X2}", header.diskSet);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.version = 0x{0:X2}", header.version);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.dataRate = 0x{0:X2}", header.dataRate);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.driveType = 0x{0:X2}", header.driveType);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.stepping = 0x{0:X2}", header.stepping);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.dosAllocation = 0x{0:X2}", header.dosAllocation);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.sides = 0x{0:X2}", header.sides);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "header.crc = 0x{0:X4}", header.crc);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "calculated header crc = 0x{0:X4}", calculatedHeaderCRC);
|
||||
|
||||
// We need more checks as the magic is too simply.
|
||||
// This may deny legal images
|
||||
@@ -343,8 +340,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
if (header.crc != calculatedHeaderCRC)
|
||||
{
|
||||
ADiskCRCHasFailed = true;
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Calculated CRC does not coincide with stored one.");
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Calculated CRC does not coincide with stored one.");
|
||||
}
|
||||
|
||||
if (header.sequence != 0x00)
|
||||
@@ -388,19 +384,16 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
UInt16 cmtcrc = TeleDiskCRC(0, commentBlockForCRC);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Comment header");
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tcommentheader.crc = 0x{0:X4}", commentHeader.crc);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tCalculated CRC = 0x{0:X4}", cmtcrc);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tcommentheader.length = {0} bytes", commentHeader.length);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tcommentheader.year = {0}", commentHeader.year);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tcommentheader.month = {0}", commentHeader.month);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tcommentheader.day = {0}", commentHeader.day);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tcommentheader.hour = {0}", commentHeader.hour);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tcommentheader.minute = {0}", commentHeader.minute);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tcommentheader.second = {0}", commentHeader.second);
|
||||
}
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Comment header");
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tcommentheader.crc = 0x{0:X4}", commentHeader.crc);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tCalculated CRC = 0x{0:X4}", cmtcrc);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tcommentheader.length = {0} bytes", commentHeader.length);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tcommentheader.year = {0}", commentHeader.year);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tcommentheader.month = {0}", commentHeader.month);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tcommentheader.day = {0}", commentHeader.day);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tcommentheader.hour = {0}", commentHeader.hour);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tcommentheader.minute = {0}", commentHeader.minute);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tcommentheader.second = {0}", commentHeader.second);
|
||||
|
||||
ADiskCRCHasFailed |= cmtcrc != commentHeader.crc;
|
||||
|
||||
@@ -413,11 +406,8 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
ImageInfo.imageComments = System.Text.Encoding.ASCII.GetString(commentBlock);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Comment");
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): {0}", ImageInfo.imageComments);
|
||||
}
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Comment");
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "{0}", ImageInfo.imageComments);
|
||||
|
||||
ImageInfo.imageCreationTime = new DateTime(commentHeader.year + 1900, commentHeader.month + 1, commentHeader.day,
|
||||
commentHeader.hour, commentHeader.minute, commentHeader.second, DateTimeKind.Unspecified);
|
||||
@@ -428,14 +418,10 @@ namespace DiscImageChef.ImagePlugins
|
||||
ImageInfo.imageCreationTime = fi.CreationTimeUtc;
|
||||
ImageInfo.imageLastModificationTime = fi.LastWriteTimeUtc;
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Image created on {0}", ImageInfo.imageCreationTime);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Image modified on {0}", ImageInfo.imageLastModificationTime);
|
||||
}
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Image created on {0}", ImageInfo.imageCreationTime);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Image modified on {0}", ImageInfo.imageLastModificationTime);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Parsing image");
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Parsing image");
|
||||
|
||||
totalDiskSize = 0;
|
||||
byte spt = 0;
|
||||
@@ -459,24 +445,18 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
TDTrackCalculatedCRC = (byte)(TeleDiskCRC(0, TDTrackForCRC) & 0xFF);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Track follows");
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tTrack cylinder: {0}\t", TDTrack.cylinder);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tTrack head: {0}\t", TDTrack.head);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tSectors in track: {0}\t", TDTrack.sectors);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tTrack header CRC: 0x{0:X2} (calculated 0x{1:X2})\t", TDTrack.crc, TDTrackCalculatedCRC);
|
||||
}
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Track follows");
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tTrack cylinder: {0}\t", TDTrack.cylinder);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tTrack head: {0}\t", TDTrack.head);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tSectors in track: {0}\t", TDTrack.sectors);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tTrack header CRC: 0x{0:X2} (calculated 0x{1:X2})\t", TDTrack.crc, TDTrackCalculatedCRC);
|
||||
|
||||
ADiskCRCHasFailed |= TDTrackCalculatedCRC != TDTrack.crc;
|
||||
|
||||
if (TDTrack.sectors == 0xFF) // End of disk image
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): End of disk image arrived");
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Total of {0} data sectors, for {1} bytes", sectorsData.Count, totalDiskSize);
|
||||
}
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "End of disk image arrived");
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Total of {0} data sectors, for {1} bytes", sectorsData.Count, totalDiskSize);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -503,16 +483,13 @@ namespace DiscImageChef.ImagePlugins
|
||||
TDSector.flags = (byte)stream.ReadByte();
|
||||
TDSector.crc = (byte)stream.ReadByte();
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \tSector follows");
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tAddressMark cylinder: {0}", TDSector.cylinder);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tAddressMark head: {0}", TDSector.head);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tAddressMark sector number: {0}", TDSector.sectorNumber);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tSector size: {0}", TDSector.sectorSize);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tSector flags: 0x{0:X2}", TDSector.flags);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tSector CRC (plus headers): 0x{0:X2}", TDSector.crc);
|
||||
}
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\tSector follows");
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tAddressMark cylinder: {0}", TDSector.cylinder);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tAddressMark head: {0}", TDSector.head);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tAddressMark sector number: {0}", TDSector.sectorNumber);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tSector size: {0}", TDSector.sectorSize);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tSector flags: 0x{0:X2}", TDSector.flags);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tSector CRC (plus headers): 0x{0:X2}", TDSector.crc);
|
||||
|
||||
UInt32 LBA = (uint)((TDSector.cylinder * header.sides * spt) + (TDSector.head * spt) + (TDSector.sectorNumber - 1));
|
||||
if ((TDSector.flags & FlagsSectorDataless) != FlagsSectorDataless && (TDSector.flags & FlagsSectorSkipped) != FlagsSectorSkipped)
|
||||
@@ -524,11 +501,8 @@ namespace DiscImageChef.ImagePlugins
|
||||
TDData.dataEncoding = (byte)stream.ReadByte();
|
||||
data = new byte[TDData.dataSize];
|
||||
stream.Read(data, 0, TDData.dataSize);
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tData size (in-image): {0}", TDData.dataSize);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tData encoding: 0x{0:X2}", TDData.dataEncoding);
|
||||
}
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tData size (in-image): {0}", TDData.dataSize);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tData encoding: 0x{0:X2}", TDData.dataEncoding);
|
||||
|
||||
decodedData = DecodeTeleDiskData(TDSector.sectorSize, TDData.dataEncoding, data);
|
||||
|
||||
@@ -536,8 +510,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
if (TDSectorCalculatedCRC != TDSector.crc)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Sector LBA {0} calculated CRC 0x{1:X2} differs from stored CRC 0x{2:X2}", LBA, TDSectorCalculatedCRC, TDSector.crc);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Sector LBA {0} calculated CRC 0x{1:X2} differs from stored CRC 0x{2:X2}", LBA, TDSectorCalculatedCRC, TDSector.crc);
|
||||
if ((TDSector.flags & FlagsSectorNoID) != FlagsSectorNoID)
|
||||
if (!sectorsData.ContainsKey(LBA) && (TDSector.flags & FlagsSectorDuplicate) != FlagsSectorDuplicate)
|
||||
SectorsWhereCRCHasFailed.Add((UInt64)LBA);
|
||||
@@ -574,8 +547,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
ArrayHelpers.ArrayFill(decodedData, (byte)0);
|
||||
}
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tLBA: {0}", LBA);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tLBA: {0}", LBA);
|
||||
|
||||
if ((TDSector.flags & FlagsSectorNoID) != FlagsSectorNoID)
|
||||
{
|
||||
@@ -583,14 +555,12 @@ namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
if ((TDSector.flags & FlagsSectorDuplicate) == FlagsSectorDuplicate)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tSector {0} on cylinder {1} head {2} is duplicate, and marked so",
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tSector {0} on cylinder {1} head {2} is duplicate, and marked so",
|
||||
TDSector.sectorNumber, TDSector.cylinder, TDSector.head);
|
||||
}
|
||||
else
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): \t\tSector {0} on cylinder {1} head {2} is duplicate, but is not marked so",
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "\t\tSector {0} on cylinder {1} head {2} is duplicate, but is not marked so",
|
||||
TDSector.sectorNumber, TDSector.cylinder, TDSector.head);
|
||||
}
|
||||
}
|
||||
@@ -840,13 +810,11 @@ namespace DiscImageChef.ImagePlugins
|
||||
ins += 4;
|
||||
outs += decodedPiece.Length;
|
||||
}
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): (Block pattern decoder): Input data size: {0} bytes", encodedData.Length);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): (Block pattern decoder): Processed input: {0} bytes", ins);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): (Block pattern decoder): Output data size: {0} bytes", decodedData.Length);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): (Block pattern decoder): Processed Output: {0} bytes", outs);
|
||||
}
|
||||
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "(Block pattern decoder): Input data size: {0} bytes", encodedData.Length);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "(Block pattern decoder): Processed input: {0} bytes", ins);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "(Block pattern decoder): Output data size: {0} bytes", decodedData.Length);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "(Block pattern decoder): Processed Output: {0} bytes", outs);
|
||||
break;
|
||||
}
|
||||
case dataBlockRLE:
|
||||
@@ -881,13 +849,12 @@ namespace DiscImageChef.ImagePlugins
|
||||
outs += Piece.Length;
|
||||
}
|
||||
}
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): (RLE decoder): Input data size: {0} bytes", encodedData.Length);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): (RLE decoder): Processed input: {0} bytes", ins);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): (RLE decoder): Output data size: {0} bytes", decodedData.Length);
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): (RLE decoder): Processed Output: {0} bytes", outs);
|
||||
}
|
||||
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "(RLE decoder): Input data size: {0} bytes", encodedData.Length);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "(RLE decoder): Processed input: {0} bytes", ins);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "(RLE decoder): Output data size: {0} bytes", decodedData.Length);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "(RLE decoder): Processed Output: {0} bytes", outs);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -967,8 +934,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
return DiskType.ECMA_78_2;
|
||||
default:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Unknown 5,25\" disk with {0} bytes", totalDiskSize);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Unknown 5,25\" disk with {0} bytes", totalDiskSize);
|
||||
return DiskType.Unknown;
|
||||
}
|
||||
}
|
||||
@@ -1012,8 +978,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
return DiskType.SHARP_35;
|
||||
default:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Unknown 3,5\" disk with {0} bytes", totalDiskSize);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Unknown 3,5\" disk with {0} bytes", totalDiskSize);
|
||||
return DiskType.Unknown;
|
||||
}
|
||||
}
|
||||
@@ -1061,16 +1026,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
return DiskType.ECMA_69_26;
|
||||
default:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Unknown 8\" disk with {0} bytes", totalDiskSize);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Unknown 8\" disk with {0} bytes", totalDiskSize);
|
||||
return DiskType.Unknown;
|
||||
}
|
||||
}
|
||||
}
|
||||
default:
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (TeleDisk plugin): Unknown drive type {1} with {0} bytes", totalDiskSize, header.driveType);
|
||||
DicConsole.DebugWriteLine("TeleDisk plugin", "Unknown drive type {1} with {0} bytes", totalDiskSize, header.driveType);
|
||||
return DiskType.Unknown;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
@@ -459,11 +460,8 @@ namespace DiscImageChef.ImagePlugins
|
||||
UInt32 headerCalculatedChecksum = VHDChecksum(header);
|
||||
UInt32 footerCalculatedChecksum = VHDChecksum(footer);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): Header checksum = 0x{0:X8}, calculated = 0x{1:X8}", headerChecksum, headerCalculatedChecksum);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): Header checksum = 0x{0:X8}, calculated = 0x{1:X8}", footerChecksum, footerCalculatedChecksum);
|
||||
}
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Header checksum = 0x{0:X8}, calculated = 0x{1:X8}", headerChecksum, headerCalculatedChecksum);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Header checksum = 0x{0:X8}, calculated = 0x{1:X8}", footerChecksum, footerCalculatedChecksum);
|
||||
|
||||
byte[] usableHeader;
|
||||
UInt32 usableChecksum;
|
||||
@@ -503,32 +501,29 @@ namespace DiscImageChef.ImagePlugins
|
||||
thisDateTime = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
thisDateTime = thisDateTime.AddSeconds(thisFooter.timestamp);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Checksums.SHA1Context sha1Ctx = new Checksums.SHA1Context();
|
||||
sha1Ctx.Init();
|
||||
sha1Ctx.Update(thisFooter.reserved);
|
||||
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.cookie = 0x{0:X8}", thisFooter.cookie);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.features = 0x{0:X8}", thisFooter.features);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.version = 0x{0:X8}", thisFooter.version);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.offset = {0}", thisFooter.offset);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.timestamp = 0x{0:X8} ({1})", thisFooter.timestamp, thisDateTime);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.creatorApplication = 0x{0:X8} (\"{1}\")", thisFooter.creatorApplication,
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.cookie = 0x{0:X8}", thisFooter.cookie);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.features = 0x{0:X8}", thisFooter.features);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.version = 0x{0:X8}", thisFooter.version);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.offset = {0}", thisFooter.offset);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.timestamp = 0x{0:X8} ({1})", thisFooter.timestamp, thisDateTime);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.creatorApplication = 0x{0:X8} (\"{1}\")", thisFooter.creatorApplication,
|
||||
Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(thisFooter.creatorApplication)));
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.creatorVersion = 0x{0:X8}", thisFooter.creatorVersion);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.creatorHostOS = 0x{0:X8} (\"{1}\")", thisFooter.creatorHostOS,
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.creatorVersion = 0x{0:X8}", thisFooter.creatorVersion);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.creatorHostOS = 0x{0:X8} (\"{1}\")", thisFooter.creatorHostOS,
|
||||
Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(thisFooter.creatorHostOS)));
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.originalSize = {0}", thisFooter.originalSize);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.currentSize = {0}", thisFooter.currentSize);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.diskGeometry = 0x{0:X8} (C/H/S: {1}/{2}/{3})", thisFooter.diskGeometry,
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.originalSize = {0}", thisFooter.originalSize);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.currentSize = {0}", thisFooter.currentSize);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.diskGeometry = 0x{0:X8} (C/H/S: {1}/{2}/{3})", thisFooter.diskGeometry,
|
||||
(thisFooter.diskGeometry & 0xFFFF0000) >> 16, (thisFooter.diskGeometry & 0xFF00) >> 8, (thisFooter.diskGeometry & 0xFF));
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.diskType = 0x{0:X8}", thisFooter.diskType);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.checksum = 0x{0:X8}", thisFooter.checksum);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.uniqueId = {0}", thisFooter.uniqueId);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.savedState = 0x{0:X2}", thisFooter.savedState);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): footer.reserved's SHA1 = 0x{0}", sha1Ctx.End());
|
||||
}
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.diskType = 0x{0:X8}", thisFooter.diskType);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.checksum = 0x{0:X8}", thisFooter.checksum);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.uniqueId = {0}", thisFooter.uniqueId);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.savedState = 0x{0:X2}", thisFooter.savedState);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "footer.reserved's SHA1 = 0x{0}", sha1Ctx.End());
|
||||
|
||||
if (thisFooter.version == Version1)
|
||||
ImageInfo.imageVersion = "1.0";
|
||||
@@ -655,8 +650,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
UInt32 dynamicChecksumCalculated = VHDChecksum(dynamicBytes);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): Dynamic header checksum = 0x{0:X8}, calculated = 0x{1:X8}", dynamicChecksum, dynamicChecksumCalculated);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Dynamic header checksum = 0x{0:X8}, calculated = 0x{1:X8}", dynamicChecksum, dynamicChecksumCalculated);
|
||||
|
||||
if (dynamicChecksum != dynamicChecksumCalculated)
|
||||
throw new ImageNotSupportedException("(VirtualPC plugin): Both header and footer are corrupt, image cannot be opened.");
|
||||
@@ -694,34 +688,31 @@ namespace DiscImageChef.ImagePlugins
|
||||
parentDateTime = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||
parentDateTime = parentDateTime.AddSeconds(thisDynamic.parentTimestamp);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Checksums.SHA1Context sha1Ctx = new Checksums.SHA1Context();
|
||||
sha1Ctx = new Checksums.SHA1Context();
|
||||
sha1Ctx.Init();
|
||||
sha1Ctx.Update(thisDynamic.reserved2);
|
||||
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.cookie = 0x{0:X8}", thisDynamic.cookie);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.dataOffset = {0}", thisDynamic.dataOffset);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.tableOffset = {0}", thisDynamic.tableOffset);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.headerVersion = 0x{0:X8}", thisDynamic.headerVersion);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.maxTableEntries = {0}", thisDynamic.maxTableEntries);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.blockSize = {0}", thisDynamic.blockSize);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.checksum = 0x{0:X8}", thisDynamic.checksum);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.parentID = {0}", thisDynamic.parentID);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.parentTimestamp = 0x{0:X8} ({1})", thisDynamic.parentTimestamp, parentDateTime);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.reserved = 0x{0:X8}", thisDynamic.reserved);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.cookie = 0x{0:X8}", thisDynamic.cookie);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.dataOffset = {0}", thisDynamic.dataOffset);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.tableOffset = {0}", thisDynamic.tableOffset);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.headerVersion = 0x{0:X8}", thisDynamic.headerVersion);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.maxTableEntries = {0}", thisDynamic.maxTableEntries);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.blockSize = {0}", thisDynamic.blockSize);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.checksum = 0x{0:X8}", thisDynamic.checksum);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.parentID = {0}", thisDynamic.parentID);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.parentTimestamp = 0x{0:X8} ({1})", thisDynamic.parentTimestamp, parentDateTime);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.reserved = 0x{0:X8}", thisDynamic.reserved);
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.locatorEntries[{0}].platformCode = 0x{1:X8} (\"{2}\")", i, thisDynamic.locatorEntries[i].platformCode,
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.locatorEntries[{0}].platformCode = 0x{1:X8} (\"{2}\")", i, thisDynamic.locatorEntries[i].platformCode,
|
||||
Encoding.ASCII.GetString(BigEndianBitConverter.GetBytes(thisDynamic.locatorEntries[i].platformCode)));
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.locatorEntries[{0}].platformDataSpace = {1}", i, thisDynamic.locatorEntries[i].platformDataSpace);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.locatorEntries[{0}].platformDataLength = {1}", i, thisDynamic.locatorEntries[i].platformDataLength);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.locatorEntries[{0}].reserved = 0x{1:X8}", i, thisDynamic.locatorEntries[i].reserved);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.locatorEntries[{0}].platformDataOffset = {1}", i, thisDynamic.locatorEntries[i].platformDataOffset);
|
||||
}
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.parentName = \"{0}\"", thisDynamic.parentName);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.reserved2's SHA1 = 0x{0}", sha1Ctx.End());
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.locatorEntries[{0}].platformDataSpace = {1}", i, thisDynamic.locatorEntries[i].platformDataSpace);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.locatorEntries[{0}].platformDataLength = {1}", i, thisDynamic.locatorEntries[i].platformDataLength);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.locatorEntries[{0}].reserved = 0x{1:X8}", i, thisDynamic.locatorEntries[i].reserved);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.locatorEntries[{0}].platformDataOffset = {1}", i, thisDynamic.locatorEntries[i].platformDataOffset);
|
||||
}
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.parentName = \"{0}\"", thisDynamic.parentName);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.reserved2's SHA1 = 0x{0}", sha1Ctx.End());
|
||||
|
||||
if (thisDynamic.headerVersion != Version1)
|
||||
throw new ImageNotSupportedException(String.Format("(VirtualPC plugin): Unknown image type {0} found. Please submit a bug with an example image.", thisFooter.diskType));
|
||||
@@ -738,11 +729,8 @@ namespace DiscImageChef.ImagePlugins
|
||||
for (int i = 0; i < thisDynamic.maxTableEntries; i++)
|
||||
blockAllocationTable[i] = BigEndianBitConverter.ToUInt32(bat, 4 * i);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
DateTime endTime = DateTime.UtcNow;
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): Filling the BAT took {0} seconds", (endTime-startTime).TotalSeconds);
|
||||
}
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Filling the BAT took {0} seconds", (endTime-startTime).TotalSeconds);
|
||||
*/
|
||||
|
||||
// How many sectors uses the BAT
|
||||
@@ -769,19 +757,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
Array.Copy(batSector.blockPointer, 0, blockAllocationTable, (i * 512) / 4, blockAllocationTable.Length - (i * 512) / 4);
|
||||
}
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
DateTime endTime = DateTime.UtcNow;
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): Filling the BAT took {0} seconds", (endTime - startTime).TotalSeconds);
|
||||
}
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Filling the BAT took {0} seconds", (endTime - startTime).TotalSeconds);
|
||||
|
||||
// Too noisy
|
||||
/*
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
for (int i = 0; i < thisDynamic.maxTableEntries; i++)
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): blockAllocationTable[{0}] = {1}", i, blockAllocationTable[i]);
|
||||
}*/
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "blockAllocationTable[{0}] = {1}", i, blockAllocationTable[i]);
|
||||
*/
|
||||
|
||||
// Get the roundest number of sectors needed to store the block bitmap
|
||||
bitmapSize = (uint)Math.Ceiling((
|
||||
@@ -791,8 +774,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
/ 8
|
||||
// and aligned to 512 byte boundary
|
||||
/ 512));
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): Bitmap is {0} sectors", bitmapSize);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Bitmap is {0} sectors", bitmapSize);
|
||||
}
|
||||
|
||||
switch (thisFooter.diskType)
|
||||
@@ -815,29 +797,26 @@ namespace DiscImageChef.ImagePlugins
|
||||
imageStream.Seek((long)thisDynamic.locatorEntries[i].platformDataOffset, SeekOrigin.Begin);
|
||||
imageStream.Read(locatorEntriesData[i], 0, (int)thisDynamic.locatorEntries[i].platformDataLength);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
switch (thisDynamic.locatorEntries[i].platformCode)
|
||||
{
|
||||
case platformCodeWindowsAbsolute:
|
||||
case platformCodeWindowsRelative:
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.locatorEntries[{0}] = \"{1}\"", i, Encoding.ASCII.GetString(locatorEntriesData[i]));
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.locatorEntries[{0}] = \"{1}\"", i, Encoding.ASCII.GetString(locatorEntriesData[i]));
|
||||
break;
|
||||
case platformCodeWindowsAbsoluteU:
|
||||
case platformCodeWindowsRelativeU:
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.locatorEntries[{0}] = \"{1}\"", i, Encoding.BigEndianUnicode.GetString(locatorEntriesData[i]));
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.locatorEntries[{0}] = \"{1}\"", i, Encoding.BigEndianUnicode.GetString(locatorEntriesData[i]));
|
||||
break;
|
||||
case platformCodeMacintoshURI:
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.locatorEntries[{0}] = \"{1}\"", i, Encoding.UTF8.GetString(locatorEntriesData[i]));
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.locatorEntries[{0}] = \"{1}\"", i, Encoding.UTF8.GetString(locatorEntriesData[i]));
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dynamic.locatorEntries[{0}] =", i);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dynamic.locatorEntries[{0}] =", i);
|
||||
PrintHex.PrintHexArray(locatorEntriesData[i], 64);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int currentLocator = 0;
|
||||
bool locatorFound = false;
|
||||
@@ -861,8 +840,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
parentPath = parentPath.Remove(0, 16);
|
||||
else
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin) Unsupported protocol classified found in URI parent path: \"{0}\"", parentPath);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Unsupported protocol classified found in URI parent path: \"{0}\"", parentPath);
|
||||
parentPath = null;
|
||||
}
|
||||
break;
|
||||
@@ -870,8 +848,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
if (parentPath != null)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin) Possible parent path: \"{0}\"", parentPath);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Possible parent path: \"{0}\"", parentPath);
|
||||
|
||||
locatorFound |= File.Exists(parentPath);
|
||||
|
||||
@@ -1026,27 +1003,23 @@ namespace DiscImageChef.ImagePlugins
|
||||
bool dirty = false || (bitmap[bitmapByte] & mask) == mask;
|
||||
|
||||
/*
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): bitmapSize = {0}", bitmapSize);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): blockNumber = {0}", blockNumber);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): sectorInBlock = {0}", sectorInBlock);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): blockOffset = {0}", blockOffset);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): bitmapByte = {0}", bitmapByte);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): bitmapBit = {0}", bitmapBit);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): mask = 0x{0:X2}", mask);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): dirty = 0x{0}", dirty);
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): bitmap = ");
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "bitmapSize = {0}", bitmapSize);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "blockNumber = {0}", blockNumber);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "sectorInBlock = {0}", sectorInBlock);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "blockOffset = {0}", blockOffset);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "bitmapByte = {0}", bitmapByte);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "bitmapBit = {0}", bitmapBit);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "mask = 0x{0:X2}", mask);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "dirty = 0x{0}", dirty);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "bitmap = ");
|
||||
PrintHex.PrintHexArray(bitmap, 64);
|
||||
}
|
||||
*/
|
||||
|
||||
// Sector has been written, read from child image
|
||||
if (dirty)
|
||||
{
|
||||
/* Too noisy
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): Sector {0} is dirty", sectorAddress);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Sector {0} is dirty", sectorAddress);
|
||||
*/
|
||||
|
||||
byte[] data = new byte[512];
|
||||
@@ -1062,8 +1035,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
|
||||
/* Too noisy
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (VirtualPC plugin): Sector {0} is clean", sectorAddress);
|
||||
DicConsole.DebugWriteLine("VirtualPC plugin", "Sector {0} is clean", sectorAddress);
|
||||
*/
|
||||
|
||||
// Read sector from parent image
|
||||
|
||||
@@ -41,6 +41,7 @@ using System.Text;
|
||||
using DiscImageChef;
|
||||
using DiscImageChef.PartPlugins;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.Plugins
|
||||
{
|
||||
@@ -199,13 +200,11 @@ namespace DiscImageChef.Plugins
|
||||
return false;
|
||||
|
||||
ulong root_ptr = BigEndianBitConverter.ToUInt32(sector, 0x08);
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (AmigaDOS plugin): Bootblock points to {0} as Rootblock", root_ptr);
|
||||
DicConsole.DebugWriteLine("AmigaDOS plugin", "Bootblock points to {0} as Rootblock", root_ptr);
|
||||
|
||||
root_ptr = (partitionEnd - partitionStart) / 2 + partitionStart;
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (AmigaDOS plugin): Nonetheless, going to block {0} for Rootblock", root_ptr);
|
||||
DicConsole.DebugWriteLine("AmigaDOS plugin", "Nonetheless, going to block {0} for Rootblock", root_ptr);
|
||||
|
||||
if (root_ptr >= imagePlugin.GetSectors())
|
||||
return false;
|
||||
@@ -242,15 +241,12 @@ namespace DiscImageChef.Plugins
|
||||
bootBlk.bootCode = new byte[BootBlockSectors.Length - 0x0C];
|
||||
Array.Copy(BootBlockSectors, 0x0C, bootBlk.bootCode, 0, BootBlockSectors.Length - 0x0C);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (AmigaDOS plugin): Stored boot blocks checksum is 0x{0:X8}", bootBlk.checksum);
|
||||
Console.WriteLine("DEBUG (AmigaDOS plugin): Probably incorrect calculated boot blocks checksum is 0x{0:X8}", AmigaChecksum(RootBlockSector));
|
||||
DicConsole.DebugWriteLine("AmigaDOS plugin", "Stored boot blocks checksum is 0x{0:X8}", bootBlk.checksum);
|
||||
DicConsole.DebugWriteLine("AmigaDOS plugin", "Probably incorrect calculated boot blocks checksum is 0x{0:X8}", AmigaChecksum(RootBlockSector));
|
||||
Checksums.SHA1Context sha1Ctx = new Checksums.SHA1Context();
|
||||
sha1Ctx.Init();
|
||||
sha1Ctx.Update(bootBlk.bootCode);
|
||||
Console.WriteLine("DEBUG (AmigaDOS plugin): Boot code SHA1 is {0}", sha1Ctx.End());
|
||||
}
|
||||
DicConsole.DebugWriteLine("AmigaDOS plugin", "Boot code SHA1 is {0}", sha1Ctx.End());
|
||||
|
||||
rootBlk.type = BigEndianBitConverter.ToUInt32(RootBlockSector, 0x00);
|
||||
rootBlk.headerKey = BigEndianBitConverter.ToUInt32(RootBlockSector, 0x04);
|
||||
@@ -290,11 +286,8 @@ namespace DiscImageChef.Plugins
|
||||
rootBlk.extension = BigEndianBitConverter.ToUInt32(RootBlockSector, (int)(0x18 + rootBlk.hashTableSize * 4 + 192));
|
||||
rootBlk.sec_type = BigEndianBitConverter.ToUInt32(RootBlockSector, (int)(0x18 + rootBlk.hashTableSize * 4 + 196));
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (AmigaDOS plugin): Stored root block checksum is 0x{0:X8}", rootBlk.checksum);
|
||||
Console.WriteLine("DEBUG (AmigaDOS plugin): Probably incorrect calculated root block checksum is 0x{0:X8}", AmigaChecksum(RootBlockSector));
|
||||
}
|
||||
DicConsole.DebugWriteLine("AmigaDOS plugin", "Stored root block checksum is 0x{0:X8}", rootBlk.checksum);
|
||||
DicConsole.DebugWriteLine("AmigaDOS plugin", "Probably incorrect calculated root block checksum is 0x{0:X8}", AmigaChecksum(RootBlockSector));
|
||||
|
||||
switch (bootBlk.diskType & 0xFF)
|
||||
{
|
||||
|
||||
@@ -42,6 +42,9 @@ using DiscImageChef;
|
||||
|
||||
// Information from Inside Macintosh
|
||||
// https://developer.apple.com/legacy/library/documentation/mac/pdf/Files/File_Manager.pdf
|
||||
using DiscImageChef.Console;
|
||||
|
||||
|
||||
namespace DiscImageChef.Plugins
|
||||
{
|
||||
class AppleHFS : Plugin
|
||||
@@ -82,8 +85,7 @@ namespace DiscImageChef.Plugins
|
||||
|
||||
if (drSigWord == HFS_MAGIC)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (HFS Plugin): HFS sector size is 512 bytes, but device's 2048");
|
||||
DicConsole.DebugWriteLine("HFS plugin", "HFS sector size is 512 bytes, but device's 2048");
|
||||
|
||||
drSigWord = BigEndianBitConverter.ToUInt16(mdb_sector, 0x7C); // Seek to embedded HFS+ signature
|
||||
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
2015-10-18 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* FAT.cs:
|
||||
* FFS.cs:
|
||||
* LisaFS.cs:
|
||||
* ProDOS.cs:
|
||||
* ISO9660.cs:
|
||||
* UNIXBFS.cs:
|
||||
* SolarFS.cs:
|
||||
* AmigaDOS.cs:
|
||||
* AppleHFS.cs:
|
||||
* DiscImageChef.Filesystems.csproj:
|
||||
Added specific console handling for standard, verbose, debug
|
||||
and error outputs.
|
||||
|
||||
2015-10-05 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* ODS.cs:
|
||||
|
||||
@@ -81,5 +81,9 @@
|
||||
<Project>{74032CBC-339B-42F3-AF6F-E96C261F3E6A}</Project>
|
||||
<Name>DiscImageChef.DiscImages</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\DiscImageChef.Console\DiscImageChef.Console.csproj">
|
||||
<Project>{CCAA7AFE-C094-4D82-A66D-630DE8A3F545}</Project>
|
||||
<Name>DiscImageChef.Console</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -42,6 +42,9 @@ using DiscImageChef;
|
||||
|
||||
// TODO: Implement detecting DOS bootable disks
|
||||
// TODO: Implement detecting Atari TOS bootable disks and printing corresponding fields
|
||||
using DiscImageChef.Console;
|
||||
|
||||
|
||||
namespace DiscImageChef.Plugins
|
||||
{
|
||||
class FAT : Plugin
|
||||
@@ -86,14 +89,11 @@ namespace DiscImageChef.Plugins
|
||||
{
|
||||
first_fat_entry = BitConverter.ToUInt32(fat_sector, 0); // Easier to manage
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (FAT plugin): fats_no = {0}", fats_no);
|
||||
Console.WriteLine("DEBUG (FAT plugin): media_descriptor = 0x{0:X2}", media_descriptor);
|
||||
Console.WriteLine("DEBUG (FAT plugin): fat32_signature = {0}", StringHandlers.CToString(fat32_signature));
|
||||
Console.WriteLine("DEBUG (FAT plugin): bps = {0}", bps);
|
||||
Console.WriteLine("DEBUG (FAT plugin): first_fat_entry = 0x{0:X8}", first_fat_entry);
|
||||
}
|
||||
DicConsole.DebugWriteLine("FAT plugin", "fats_no = {0}", fats_no);
|
||||
DicConsole.DebugWriteLine("FAT plugin", "media_descriptor = 0x{0:X2}", media_descriptor);
|
||||
DicConsole.DebugWriteLine("FAT plugin", "fat32_signature = {0}", StringHandlers.CToString(fat32_signature));
|
||||
DicConsole.DebugWriteLine("FAT plugin", "bps = {0}", bps);
|
||||
DicConsole.DebugWriteLine("FAT plugin", "first_fat_entry = 0x{0:X8}", first_fat_entry);
|
||||
|
||||
if (fats_no > 2) // Must be 1 or 2, but as TOS makes strange things and I have not checked if it puts this to 0, ignore if 0. MUST NOT BE BIGGER THAN 2!
|
||||
return false;
|
||||
|
||||
@@ -41,6 +41,9 @@ using System.Text;
|
||||
using DiscImageChef;
|
||||
|
||||
// Using information from Linux kernel headers
|
||||
using DiscImageChef.Console;
|
||||
|
||||
|
||||
namespace DiscImageChef.Plugins
|
||||
{
|
||||
public class FFSPlugin : Plugin
|
||||
@@ -379,138 +382,135 @@ namespace DiscImageChef.Plugins
|
||||
ufs_sb.fs_magic = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x055C); // 0x055C magic number
|
||||
ufs_sb.fs_space = ufs_sb_sectors[0x0560]; // 0x0560 list of blocks for each rotation
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("ufs_sb offset: 0x{0:X8}", sb_offset);
|
||||
Console.WriteLine("fs_link_42bsd: 0x{0:X8}", ufs_sb.fs_link_42bsd);
|
||||
Console.WriteLine("fs_state_sun: 0x{0:X8}", ufs_sb.fs_state_sun);
|
||||
Console.WriteLine("fs_rlink: 0x{0:X8}", ufs_sb.fs_rlink);
|
||||
Console.WriteLine("fs_sblkno: 0x{0:X8}", ufs_sb.fs_sblkno);
|
||||
Console.WriteLine("fs_cblkno: 0x{0:X8}", ufs_sb.fs_cblkno);
|
||||
Console.WriteLine("fs_iblkno: 0x{0:X8}", ufs_sb.fs_iblkno);
|
||||
Console.WriteLine("fs_dblkno: 0x{0:X8}", ufs_sb.fs_dblkno);
|
||||
Console.WriteLine("fs_cgoffset: 0x{0:X8}", ufs_sb.fs_cgoffset);
|
||||
Console.WriteLine("fs_cgmask: 0x{0:X8}", ufs_sb.fs_cgmask);
|
||||
Console.WriteLine("fs_time_t: 0x{0:X8}", ufs_sb.fs_time_t);
|
||||
Console.WriteLine("fs_size: 0x{0:X8}", ufs_sb.fs_size);
|
||||
Console.WriteLine("fs_dsize: 0x{0:X8}", ufs_sb.fs_dsize);
|
||||
Console.WriteLine("fs_ncg: 0x{0:X8}", ufs_sb.fs_ncg);
|
||||
Console.WriteLine("fs_bsize: 0x{0:X8}", ufs_sb.fs_bsize);
|
||||
Console.WriteLine("fs_fsize: 0x{0:X8}", ufs_sb.fs_fsize);
|
||||
Console.WriteLine("fs_frag: 0x{0:X8}", ufs_sb.fs_frag);
|
||||
Console.WriteLine("fs_minfree: 0x{0:X8}", ufs_sb.fs_minfree);
|
||||
Console.WriteLine("fs_rotdelay: 0x{0:X8}", ufs_sb.fs_rotdelay);
|
||||
Console.WriteLine("fs_rps: 0x{0:X8}", ufs_sb.fs_rps);
|
||||
Console.WriteLine("fs_bmask: 0x{0:X8}", ufs_sb.fs_bmask);
|
||||
Console.WriteLine("fs_fmask: 0x{0:X8}", ufs_sb.fs_fmask);
|
||||
Console.WriteLine("fs_bshift: 0x{0:X8}", ufs_sb.fs_bshift);
|
||||
Console.WriteLine("fs_fshift: 0x{0:X8}", ufs_sb.fs_fshift);
|
||||
Console.WriteLine("fs_maxcontig: 0x{0:X8}", ufs_sb.fs_maxcontig);
|
||||
Console.WriteLine("fs_maxbpg: 0x{0:X8}", ufs_sb.fs_maxbpg);
|
||||
Console.WriteLine("fs_fragshift: 0x{0:X8}", ufs_sb.fs_fragshift);
|
||||
Console.WriteLine("fs_fsbtodb: 0x{0:X8}", ufs_sb.fs_fsbtodb);
|
||||
Console.WriteLine("fs_sbsize: 0x{0:X8}", ufs_sb.fs_sbsize);
|
||||
Console.WriteLine("fs_csmask: 0x{0:X8}", ufs_sb.fs_csmask);
|
||||
Console.WriteLine("fs_csshift: 0x{0:X8}", ufs_sb.fs_csshift);
|
||||
Console.WriteLine("fs_nindir: 0x{0:X8}", ufs_sb.fs_nindir);
|
||||
Console.WriteLine("fs_inopb: 0x{0:X8}", ufs_sb.fs_inopb);
|
||||
Console.WriteLine("fs_nspf: 0x{0:X8}", ufs_sb.fs_nspf);
|
||||
Console.WriteLine("fs_optim: 0x{0:X8}", ufs_sb.fs_optim);
|
||||
Console.WriteLine("fs_npsect_sun: 0x{0:X8}", ufs_sb.fs_npsect_sun);
|
||||
Console.WriteLine("fs_state_t_sun86: 0x{0:X8}", ufs_sb.fs_state_t_sun86);
|
||||
Console.WriteLine("fs_interleave: 0x{0:X8}", ufs_sb.fs_interleave);
|
||||
Console.WriteLine("fs_trackskew: 0x{0:X8}", ufs_sb.fs_trackskew);
|
||||
Console.WriteLine("fs_id_1: 0x{0:X8}", ufs_sb.fs_id_1);
|
||||
Console.WriteLine("fs_id_2: 0x{0:X8}", ufs_sb.fs_id_2);
|
||||
Console.WriteLine("fs_headswitch_43bsd: 0x{0:X8}", ufs_sb.fs_headswitch_43bsd);
|
||||
Console.WriteLine("fs_trkseek_43bsd: 0x{0:X8}", ufs_sb.fs_trkseek_43bsd);
|
||||
Console.WriteLine("fs_csaddr: 0x{0:X8}", ufs_sb.fs_csaddr);
|
||||
Console.WriteLine("fs_cssize: 0x{0:X8}", ufs_sb.fs_cssize);
|
||||
Console.WriteLine("fs_cgsize: 0x{0:X8}", ufs_sb.fs_cgsize);
|
||||
Console.WriteLine("fs_ntrak: 0x{0:X8}", ufs_sb.fs_ntrak);
|
||||
Console.WriteLine("fs_nsect: 0x{0:X8}", ufs_sb.fs_nsect);
|
||||
Console.WriteLine("fs_spc: 0x{0:X8}", ufs_sb.fs_spc);
|
||||
Console.WriteLine("fs_ncyl: 0x{0:X8}", ufs_sb.fs_ncyl);
|
||||
Console.WriteLine("fs_cpg: 0x{0:X8}", ufs_sb.fs_cpg);
|
||||
Console.WriteLine("fs_ipg: 0x{0:X8}", ufs_sb.fs_ipg);
|
||||
Console.WriteLine("fs_fpg: 0x{0:X8}", ufs_sb.fs_fpg);
|
||||
Console.WriteLine("fs_cstotal_ndir: 0x{0:X8}", ufs_sb.fs_cstotal_ndir);
|
||||
Console.WriteLine("fs_cstotal_nbfree: 0x{0:X8}", ufs_sb.fs_cstotal_nbfree);
|
||||
Console.WriteLine("fs_cstotal_nifree: 0x{0:X8}", ufs_sb.fs_cstotal_nifree);
|
||||
Console.WriteLine("fs_cstotal_nffree: 0x{0:X8}", ufs_sb.fs_cstotal_nffree);
|
||||
Console.WriteLine("fs_fmod: 0x{0:X2}", ufs_sb.fs_fmod);
|
||||
Console.WriteLine("fs_clean: 0x{0:X2}", ufs_sb.fs_clean);
|
||||
Console.WriteLine("fs_ronly: 0x{0:X2}", ufs_sb.fs_ronly);
|
||||
Console.WriteLine("fs_flags: 0x{0:X2}", ufs_sb.fs_flags);
|
||||
Console.WriteLine("fs_fsmnt_ufs1: {0}", ufs_sb.fs_fsmnt_ufs1);
|
||||
Console.WriteLine("fs_cgrotor_ufs1: 0x{0:X8}", ufs_sb.fs_cgrotor_ufs1);
|
||||
Console.WriteLine("fs_cs_ufs1: 0x{0:X}", ufs_sb.fs_cs_ufs1);
|
||||
Console.WriteLine("fs_maxcluster_ufs1: 0x{0:X8}", ufs_sb.fs_maxcluster_ufs1);
|
||||
Console.WriteLine("fs_cpc_ufs1: 0x{0:X8}", ufs_sb.fs_cpc_ufs1);
|
||||
Console.WriteLine("fs_opostbl_ufs1: 0x{0:X}", ufs_sb.fs_opostbl_ufs1);
|
||||
Console.WriteLine("fs_fsmnt_ufs2: {0}", ufs_sb.fs_fsmnt_ufs2);
|
||||
Console.WriteLine("fs_volname_ufs2: {0}", ufs_sb.fs_volname_ufs2);
|
||||
Console.WriteLine("fs_swuid_ufs2: 0x{0:X16}", ufs_sb.fs_swuid_ufs2);
|
||||
Console.WriteLine("fs_pad_ufs2: 0x{0:X8}", ufs_sb.fs_pad_ufs2);
|
||||
Console.WriteLine("fs_cgrotor_ufs2: 0x{0:X8}", ufs_sb.fs_cgrotor_ufs2);
|
||||
Console.WriteLine("fs_ocsp_ufs2: 0x{0:X}", ufs_sb.fs_ocsp_ufs2);
|
||||
Console.WriteLine("fs_contigdirs_ufs2: 0x{0:X8}", ufs_sb.fs_contigdirs_ufs2);
|
||||
Console.WriteLine("fs_csp_ufs2: 0x{0:X8}", ufs_sb.fs_csp_ufs2);
|
||||
Console.WriteLine("fs_maxcluster_ufs2: 0x{0:X8}", ufs_sb.fs_maxcluster_ufs2);
|
||||
Console.WriteLine("fs_active_ufs2: 0x{0:X8}", ufs_sb.fs_active_ufs2);
|
||||
Console.WriteLine("fs_old_cpc_ufs2: 0x{0:X8}", ufs_sb.fs_old_cpc_ufs2);
|
||||
Console.WriteLine("fs_maxbsize_ufs2: 0x{0:X8}", ufs_sb.fs_maxbsize_ufs2);
|
||||
Console.WriteLine("fs_sparecon64_ufs2: 0x{0:X}", ufs_sb.fs_sparecon64_ufs2);
|
||||
Console.WriteLine("fs_sblockloc_ufs2: 0x{0:X16}", ufs_sb.fs_sblockloc_ufs2);
|
||||
Console.WriteLine("fs_cstotal_ndir_ufs2: 0x{0:X16}", ufs_sb.fs_cstotal_ndir_ufs2);
|
||||
Console.WriteLine("fs_cstotal_nbfree_ufs2: 0x{0:X16}", ufs_sb.fs_cstotal_nbfree_ufs2);
|
||||
Console.WriteLine("fs_cstotal_nifree_ufs2: 0x{0:X16}", ufs_sb.fs_cstotal_nifree_ufs2);
|
||||
Console.WriteLine("fs_cstotal_nffree_ufs2: 0x{0:X16}", ufs_sb.fs_cstotal_nffree_ufs2);
|
||||
Console.WriteLine("fs_cstotal_numclusters_ufs2: 0x{0:X16}", ufs_sb.fs_cstotal_numclusters_ufs2);
|
||||
Console.WriteLine("fs_cstotal_spare0_ufs2: 0x{0:X16}", ufs_sb.fs_cstotal_spare0_ufs2);
|
||||
Console.WriteLine("fs_cstotal_spare1_ufs2: 0x{0:X16}", ufs_sb.fs_cstotal_spare1_ufs2);
|
||||
Console.WriteLine("fs_cstotal_spare2_ufs2: 0x{0:X16}", ufs_sb.fs_cstotal_spare2_ufs2);
|
||||
Console.WriteLine("fs_time_sec_ufs2: 0x{0:X8}", ufs_sb.fs_time_sec_ufs2);
|
||||
Console.WriteLine("fs_time_usec_ufs2: 0x{0:X8}", ufs_sb.fs_time_usec_ufs2);
|
||||
Console.WriteLine("fs_size_ufs2: 0x{0:X16}", ufs_sb.fs_size_ufs2);
|
||||
Console.WriteLine("fs_dsize_ufs2: 0x{0:X16}", ufs_sb.fs_dsize_ufs2);
|
||||
Console.WriteLine("fs_csaddr_ufs2: 0x{0:X16}", ufs_sb.fs_csaddr_ufs2);
|
||||
Console.WriteLine("fs_pendingblocks_ufs2: 0x{0:X16}", ufs_sb.fs_pendingblocks_ufs2);
|
||||
Console.WriteLine("fs_pendinginodes_ufs2: 0x{0:X8}", ufs_sb.fs_pendinginodes_ufs2);
|
||||
Console.WriteLine("fs_sparecon_sun: 0x{0:X}", ufs_sb.fs_sparecon_sun);
|
||||
Console.WriteLine("fs_reclaim_sun: 0x{0:X8}", ufs_sb.fs_reclaim_sun);
|
||||
Console.WriteLine("fs_sparecon2_sun: 0x{0:X8}", ufs_sb.fs_sparecon2_sun);
|
||||
Console.WriteLine("fs_state_t_sun: 0x{0:X8}", ufs_sb.fs_state_t_sun);
|
||||
Console.WriteLine("fs_qbmask0_sun: 0x{0:X8}", ufs_sb.fs_qbmask0_sun);
|
||||
Console.WriteLine("fs_qbmask1_sun: 0x{0:X8}", ufs_sb.fs_qbmask1_sun);
|
||||
Console.WriteLine("fs_qfmask0_sun: 0x{0:X8}", ufs_sb.fs_qfmask0_sun);
|
||||
Console.WriteLine("fs_qfmask1_sun: 0x{0:X8}", ufs_sb.fs_qfmask1_sun);
|
||||
Console.WriteLine("fs_sparecon_sun86: 0x{0:X}", ufs_sb.fs_sparecon_sun86);
|
||||
Console.WriteLine("fs_reclaim_sun86: 0x{0:X8}", ufs_sb.fs_reclaim_sun86);
|
||||
Console.WriteLine("fs_sparecon2_sun86: 0x{0:X8}", ufs_sb.fs_sparecon2_sun86);
|
||||
Console.WriteLine("fs_npsect_sun86: 0x{0:X8}", ufs_sb.fs_npsect_sun86);
|
||||
Console.WriteLine("fs_qbmask0_sun86: 0x{0:X8}", ufs_sb.fs_qbmask0_sun86);
|
||||
Console.WriteLine("fs_qbmask1_sun86: 0x{0:X8}", ufs_sb.fs_qbmask1_sun86);
|
||||
Console.WriteLine("fs_qfmask0_sun86: 0x{0:X8}", ufs_sb.fs_qfmask0_sun86);
|
||||
Console.WriteLine("fs_qfmask1_sun86: 0x{0:X8}", ufs_sb.fs_qfmask1_sun86);
|
||||
Console.WriteLine("fs_sparecon_44bsd: 0x{0:X}", ufs_sb.fs_sparecon_44bsd);
|
||||
Console.WriteLine("fs_contigsumsize_44bsd: 0x{0:X8}", ufs_sb.fs_contigsumsize_44bsd);
|
||||
Console.WriteLine("fs_maxsymlinklen_44bsd: 0x{0:X8}", ufs_sb.fs_maxsymlinklen_44bsd);
|
||||
Console.WriteLine("fs_inodefmt_44bsd: 0x{0:X8}", ufs_sb.fs_inodefmt_44bsd);
|
||||
Console.WriteLine("fs_maxfilesize0_44bsd: 0x{0:X8}", ufs_sb.fs_maxfilesize0_44bsd);
|
||||
Console.WriteLine("fs_maxfilesize1_44bsd: 0x{0:X8}", ufs_sb.fs_maxfilesize1_44bsd);
|
||||
Console.WriteLine("fs_qbmask0_44bsd: 0x{0:X8}", ufs_sb.fs_qbmask0_44bsd);
|
||||
Console.WriteLine("fs_qbmask1_44bsd: 0x{0:X8}", ufs_sb.fs_qbmask1_44bsd);
|
||||
Console.WriteLine("fs_qfmask0_44bsd: 0x{0:X8}", ufs_sb.fs_qfmask0_44bsd);
|
||||
Console.WriteLine("fs_qfmask1_44bsd: 0x{0:X8}", ufs_sb.fs_qfmask1_44bsd);
|
||||
Console.WriteLine("fs_state_t_44bsd: 0x{0:X8}", ufs_sb.fs_state_t_44bsd);
|
||||
Console.WriteLine("fs_postblformat: 0x{0:X8}", ufs_sb.fs_postblformat);
|
||||
Console.WriteLine("fs_nrpos: 0x{0:X8}", ufs_sb.fs_nrpos);
|
||||
Console.WriteLine("fs_postbloff: 0x{0:X8}", ufs_sb.fs_postbloff);
|
||||
Console.WriteLine("fs_rotbloff: 0x{0:X8}", ufs_sb.fs_rotbloff);
|
||||
Console.WriteLine("fs_magic: 0x{0:X8}", ufs_sb.fs_magic);
|
||||
Console.WriteLine("fs_space: 0x{0:X2}", ufs_sb.fs_space);
|
||||
}
|
||||
DicConsole.DebugWriteLine("FFS plugin", "ufs_sb offset: 0x{0:X8}", sb_offset);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_link_42bsd: 0x{0:X8}", ufs_sb.fs_link_42bsd);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_state_sun: 0x{0:X8}", ufs_sb.fs_state_sun);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_rlink: 0x{0:X8}", ufs_sb.fs_rlink);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_sblkno: 0x{0:X8}", ufs_sb.fs_sblkno);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cblkno: 0x{0:X8}", ufs_sb.fs_cblkno);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_iblkno: 0x{0:X8}", ufs_sb.fs_iblkno);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_dblkno: 0x{0:X8}", ufs_sb.fs_dblkno);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cgoffset: 0x{0:X8}", ufs_sb.fs_cgoffset);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cgmask: 0x{0:X8}", ufs_sb.fs_cgmask);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_time_t: 0x{0:X8}", ufs_sb.fs_time_t);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_size: 0x{0:X8}", ufs_sb.fs_size);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_dsize: 0x{0:X8}", ufs_sb.fs_dsize);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_ncg: 0x{0:X8}", ufs_sb.fs_ncg);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_bsize: 0x{0:X8}", ufs_sb.fs_bsize);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_fsize: 0x{0:X8}", ufs_sb.fs_fsize);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_frag: 0x{0:X8}", ufs_sb.fs_frag);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_minfree: 0x{0:X8}", ufs_sb.fs_minfree);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_rotdelay: 0x{0:X8}", ufs_sb.fs_rotdelay);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_rps: 0x{0:X8}", ufs_sb.fs_rps);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_bmask: 0x{0:X8}", ufs_sb.fs_bmask);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_fmask: 0x{0:X8}", ufs_sb.fs_fmask);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_bshift: 0x{0:X8}", ufs_sb.fs_bshift);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_fshift: 0x{0:X8}", ufs_sb.fs_fshift);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_maxcontig: 0x{0:X8}", ufs_sb.fs_maxcontig);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_maxbpg: 0x{0:X8}", ufs_sb.fs_maxbpg);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_fragshift: 0x{0:X8}", ufs_sb.fs_fragshift);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_fsbtodb: 0x{0:X8}", ufs_sb.fs_fsbtodb);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_sbsize: 0x{0:X8}", ufs_sb.fs_sbsize);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_csmask: 0x{0:X8}", ufs_sb.fs_csmask);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_csshift: 0x{0:X8}", ufs_sb.fs_csshift);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_nindir: 0x{0:X8}", ufs_sb.fs_nindir);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_inopb: 0x{0:X8}", ufs_sb.fs_inopb);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_nspf: 0x{0:X8}", ufs_sb.fs_nspf);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_optim: 0x{0:X8}", ufs_sb.fs_optim);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_npsect_sun: 0x{0:X8}", ufs_sb.fs_npsect_sun);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_state_t_sun86: 0x{0:X8}", ufs_sb.fs_state_t_sun86);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_interleave: 0x{0:X8}", ufs_sb.fs_interleave);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_trackskew: 0x{0:X8}", ufs_sb.fs_trackskew);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_id_1: 0x{0:X8}", ufs_sb.fs_id_1);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_id_2: 0x{0:X8}", ufs_sb.fs_id_2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_headswitch_43bsd: 0x{0:X8}", ufs_sb.fs_headswitch_43bsd);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_trkseek_43bsd: 0x{0:X8}", ufs_sb.fs_trkseek_43bsd);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_csaddr: 0x{0:X8}", ufs_sb.fs_csaddr);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cssize: 0x{0:X8}", ufs_sb.fs_cssize);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cgsize: 0x{0:X8}", ufs_sb.fs_cgsize);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_ntrak: 0x{0:X8}", ufs_sb.fs_ntrak);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_nsect: 0x{0:X8}", ufs_sb.fs_nsect);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_spc: 0x{0:X8}", ufs_sb.fs_spc);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_ncyl: 0x{0:X8}", ufs_sb.fs_ncyl);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cpg: 0x{0:X8}", ufs_sb.fs_cpg);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_ipg: 0x{0:X8}", ufs_sb.fs_ipg);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_fpg: 0x{0:X8}", ufs_sb.fs_fpg);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cstotal_ndir: 0x{0:X8}", ufs_sb.fs_cstotal_ndir);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cstotal_nbfree: 0x{0:X8}", ufs_sb.fs_cstotal_nbfree);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cstotal_nifree: 0x{0:X8}", ufs_sb.fs_cstotal_nifree);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cstotal_nffree: 0x{0:X8}", ufs_sb.fs_cstotal_nffree);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_fmod: 0x{0:X2}", ufs_sb.fs_fmod);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_clean: 0x{0:X2}", ufs_sb.fs_clean);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_ronly: 0x{0:X2}", ufs_sb.fs_ronly);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_flags: 0x{0:X2}", ufs_sb.fs_flags);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_fsmnt_ufs1: {0}", ufs_sb.fs_fsmnt_ufs1);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cgrotor_ufs1: 0x{0:X8}", ufs_sb.fs_cgrotor_ufs1);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cs_ufs1: 0x{0:X}", ufs_sb.fs_cs_ufs1);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_maxcluster_ufs1: 0x{0:X8}", ufs_sb.fs_maxcluster_ufs1);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cpc_ufs1: 0x{0:X8}", ufs_sb.fs_cpc_ufs1);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_opostbl_ufs1: 0x{0:X}", ufs_sb.fs_opostbl_ufs1);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_fsmnt_ufs2: {0}", ufs_sb.fs_fsmnt_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_volname_ufs2: {0}", ufs_sb.fs_volname_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_swuid_ufs2: 0x{0:X16}", ufs_sb.fs_swuid_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_pad_ufs2: 0x{0:X8}", ufs_sb.fs_pad_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cgrotor_ufs2: 0x{0:X8}", ufs_sb.fs_cgrotor_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_ocsp_ufs2: 0x{0:X}", ufs_sb.fs_ocsp_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_contigdirs_ufs2: 0x{0:X8}", ufs_sb.fs_contigdirs_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_csp_ufs2: 0x{0:X8}", ufs_sb.fs_csp_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_maxcluster_ufs2: 0x{0:X8}", ufs_sb.fs_maxcluster_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_active_ufs2: 0x{0:X8}", ufs_sb.fs_active_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_old_cpc_ufs2: 0x{0:X8}", ufs_sb.fs_old_cpc_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_maxbsize_ufs2: 0x{0:X8}", ufs_sb.fs_maxbsize_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_sparecon64_ufs2: 0x{0:X}", ufs_sb.fs_sparecon64_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_sblockloc_ufs2: 0x{0:X16}", ufs_sb.fs_sblockloc_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cstotal_ndir_ufs2: 0x{0:X16}", ufs_sb.fs_cstotal_ndir_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cstotal_nbfree_ufs2: 0x{0:X16}", ufs_sb.fs_cstotal_nbfree_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cstotal_nifree_ufs2: 0x{0:X16}", ufs_sb.fs_cstotal_nifree_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cstotal_nffree_ufs2: 0x{0:X16}", ufs_sb.fs_cstotal_nffree_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cstotal_numclusters_ufs2: 0x{0:X16}", ufs_sb.fs_cstotal_numclusters_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cstotal_spare0_ufs2: 0x{0:X16}", ufs_sb.fs_cstotal_spare0_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cstotal_spare1_ufs2: 0x{0:X16}", ufs_sb.fs_cstotal_spare1_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_cstotal_spare2_ufs2: 0x{0:X16}", ufs_sb.fs_cstotal_spare2_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_time_sec_ufs2: 0x{0:X8}", ufs_sb.fs_time_sec_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_time_usec_ufs2: 0x{0:X8}", ufs_sb.fs_time_usec_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_size_ufs2: 0x{0:X16}", ufs_sb.fs_size_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_dsize_ufs2: 0x{0:X16}", ufs_sb.fs_dsize_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_csaddr_ufs2: 0x{0:X16}", ufs_sb.fs_csaddr_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_pendingblocks_ufs2: 0x{0:X16}", ufs_sb.fs_pendingblocks_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_pendinginodes_ufs2: 0x{0:X8}", ufs_sb.fs_pendinginodes_ufs2);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_sparecon_sun: 0x{0:X}", ufs_sb.fs_sparecon_sun);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_reclaim_sun: 0x{0:X8}", ufs_sb.fs_reclaim_sun);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_sparecon2_sun: 0x{0:X8}", ufs_sb.fs_sparecon2_sun);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_state_t_sun: 0x{0:X8}", ufs_sb.fs_state_t_sun);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_qbmask0_sun: 0x{0:X8}", ufs_sb.fs_qbmask0_sun);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_qbmask1_sun: 0x{0:X8}", ufs_sb.fs_qbmask1_sun);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_qfmask0_sun: 0x{0:X8}", ufs_sb.fs_qfmask0_sun);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_qfmask1_sun: 0x{0:X8}", ufs_sb.fs_qfmask1_sun);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_sparecon_sun86: 0x{0:X}", ufs_sb.fs_sparecon_sun86);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_reclaim_sun86: 0x{0:X8}", ufs_sb.fs_reclaim_sun86);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_sparecon2_sun86: 0x{0:X8}", ufs_sb.fs_sparecon2_sun86);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_npsect_sun86: 0x{0:X8}", ufs_sb.fs_npsect_sun86);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_qbmask0_sun86: 0x{0:X8}", ufs_sb.fs_qbmask0_sun86);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_qbmask1_sun86: 0x{0:X8}", ufs_sb.fs_qbmask1_sun86);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_qfmask0_sun86: 0x{0:X8}", ufs_sb.fs_qfmask0_sun86);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_qfmask1_sun86: 0x{0:X8}", ufs_sb.fs_qfmask1_sun86);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_sparecon_44bsd: 0x{0:X}", ufs_sb.fs_sparecon_44bsd);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_contigsumsize_44bsd: 0x{0:X8}", ufs_sb.fs_contigsumsize_44bsd);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_maxsymlinklen_44bsd: 0x{0:X8}", ufs_sb.fs_maxsymlinklen_44bsd);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_inodefmt_44bsd: 0x{0:X8}", ufs_sb.fs_inodefmt_44bsd);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_maxfilesize0_44bsd: 0x{0:X8}", ufs_sb.fs_maxfilesize0_44bsd);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_maxfilesize1_44bsd: 0x{0:X8}", ufs_sb.fs_maxfilesize1_44bsd);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_qbmask0_44bsd: 0x{0:X8}", ufs_sb.fs_qbmask0_44bsd);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_qbmask1_44bsd: 0x{0:X8}", ufs_sb.fs_qbmask1_44bsd);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_qfmask0_44bsd: 0x{0:X8}", ufs_sb.fs_qfmask0_44bsd);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_qfmask1_44bsd: 0x{0:X8}", ufs_sb.fs_qfmask1_44bsd);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_state_t_44bsd: 0x{0:X8}", ufs_sb.fs_state_t_44bsd);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_postblformat: 0x{0:X8}", ufs_sb.fs_postblformat);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_nrpos: 0x{0:X8}", ufs_sb.fs_nrpos);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_postbloff: 0x{0:X8}", ufs_sb.fs_postbloff);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_rotbloff: 0x{0:X8}", ufs_sb.fs_rotbloff);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_magic: 0x{0:X8}", ufs_sb.fs_magic);
|
||||
DicConsole.DebugWriteLine("FFS plugin", "fs_space: 0x{0:X2}", ufs_sb.fs_space);
|
||||
|
||||
sbInformation.AppendLine("There are a lot of variants of UFS using overlapped values on same fields");
|
||||
sbInformation.AppendLine("I will try to guess which one it is, but unless it's UFS2, I may be surely wrong");
|
||||
|
||||
@@ -45,6 +45,9 @@ using DiscImageChef;
|
||||
// TODO: Differentiate ISO Level 1, 2, 3 and ISO 9660:1999
|
||||
// TODO: Apple extensiones, requires XA or advance RR interpretation.
|
||||
// TODO: Needs a major rewrite
|
||||
using DiscImageChef.Console;
|
||||
|
||||
|
||||
namespace DiscImageChef.Plugins
|
||||
{
|
||||
class ISO9660Plugin : Plugin
|
||||
@@ -156,16 +159,13 @@ namespace DiscImageChef.Plugins
|
||||
|
||||
while (true)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): Processing VD loop no. {0}", counter);
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "Processing VD loop no. {0}", counter);
|
||||
// Seek to Volume Descriptor
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): Reading sector {0}", 16 + counter + partitionStart);
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "Reading sector {0}", 16 + counter + partitionStart);
|
||||
byte[] vd_sector = imagePlugin.ReadSector(16 + counter + partitionStart);
|
||||
|
||||
VDType = vd_sector[0];
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): VDType = {0}", VDType);
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "VDType = {0}", VDType);
|
||||
|
||||
if (VDType == 255) // Supposedly we are in the PVD.
|
||||
{
|
||||
@@ -271,8 +271,7 @@ namespace DiscImageChef.Plugins
|
||||
|
||||
|
||||
ulong i = (ulong)BitConverter.ToInt32(VDPathTableStart, 0);
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): VDPathTableStart = {0} + {1} = {2}", i, partitionStart, i + partitionStart);
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "VDPathTableStart = {0} + {1} = {2}", i, partitionStart, i + partitionStart);
|
||||
|
||||
// TODO: Check this
|
||||
if ((i + partitionStart) < imagePlugin.GetSectors())
|
||||
@@ -305,8 +304,7 @@ namespace DiscImageChef.Plugins
|
||||
byte[] ipbin_sector = imagePlugin.ReadSector(0 + partitionStart);
|
||||
Array.Copy(ipbin_sector, 0x000, SegaHardwareID, 0, 16);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): SegaHardwareID = \"{0}\"", Encoding.ASCII.GetString(SegaHardwareID));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "SegaHardwareID = \"{0}\"", Encoding.ASCII.GetString(SegaHardwareID));
|
||||
|
||||
switch (Encoding.ASCII.GetString(SegaHardwareID))
|
||||
{
|
||||
@@ -316,8 +314,7 @@ namespace DiscImageChef.Plugins
|
||||
{
|
||||
SegaCD = true; // Ok, this contains SegaCD IP.BIN
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): Found SegaCD IP.BIN");
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "Found SegaCD IP.BIN");
|
||||
|
||||
IPBinInformation.AppendLine("--------------------------------");
|
||||
IPBinInformation.AppendLine("SEGA IP.BIN INFORMATION:");
|
||||
@@ -393,30 +390,27 @@ namespace DiscImageChef.Plugins
|
||||
Array.Copy(ipbin_sector, 0x1B0, spare_space7, 0, 64); // Inside here should be modem information, but I need to get a modem-enabled game
|
||||
Array.Copy(ipbin_sector, 0x1F0, region_codes, 0, 16); // Region codes, space-filled
|
||||
|
||||
//if(MainClass.isDebug)
|
||||
//{
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.volume_name = \"{0}\"", Encoding.ASCII.GetString(volume_name));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.system_name = \"{0}\"", Encoding.ASCII.GetString(system_name));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.volume_version = \"{0}\"", Encoding.ASCII.GetString(volume_version));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.volume_type = 0x{0}", BitConverter.ToInt32(volume_type, 0).ToString("X"));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.system_version = 0x{0}", BitConverter.ToInt32(system_version, 0).ToString("X"));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.ip_address = 0x{0}", BitConverter.ToInt32(ip_address, 0).ToString("X"));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.ip_loadsize = {0}", BitConverter.ToInt32(ip_loadsize, 0));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.ip_entry_address = 0x{0}", BitConverter.ToInt32(ip_entry_address, 0).ToString("X"));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.ip_work_ram_size = {0}", BitConverter.ToInt32(ip_work_ram_size, 0));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.sp_address = 0x{0}", BitConverter.ToInt32(sp_address, 0).ToString("X"));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.sp_loadsize = {0}", BitConverter.ToInt32(sp_loadsize, 0));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.sp_entry_address = 0x{0}", BitConverter.ToInt32(sp_entry_address, 0).ToString("X"));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.sp_work_ram_size = {0}", BitConverter.ToInt32(sp_work_ram_size, 0));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.release_date = \"{0}\"", Encoding.ASCII.GetString(release_date));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.release_date2 = \"{0}\"", Encoding.ASCII.GetString(release_date2));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.developer_code = \"{0}\"", Encoding.ASCII.GetString(developer_code));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.domestic_title = \"{0}\"", Encoding.ASCII.GetString(domestic_title));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.overseas_title = \"{0}\"", Encoding.ASCII.GetString(overseas_title));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.product_code = \"{0}\"", Encoding.ASCII.GetString(product_code));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.peripherals = \"{0}\"", Encoding.ASCII.GetString(peripherals));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): segacd_ipbin.region_codes = \"{0}\"", Encoding.ASCII.GetString(region_codes));
|
||||
//}
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.volume_name = \"{0}\"", Encoding.ASCII.GetString(volume_name));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.system_name = \"{0}\"", Encoding.ASCII.GetString(system_name));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.volume_version = \"{0}\"", Encoding.ASCII.GetString(volume_version));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.volume_type = 0x{0}", BitConverter.ToInt32(volume_type, 0).ToString("X"));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.system_version = 0x{0}", BitConverter.ToInt32(system_version, 0).ToString("X"));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.ip_address = 0x{0}", BitConverter.ToInt32(ip_address, 0).ToString("X"));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.ip_loadsize = {0}", BitConverter.ToInt32(ip_loadsize, 0));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.ip_entry_address = 0x{0}", BitConverter.ToInt32(ip_entry_address, 0).ToString("X"));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.ip_work_ram_size = {0}", BitConverter.ToInt32(ip_work_ram_size, 0));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.sp_address = 0x{0}", BitConverter.ToInt32(sp_address, 0).ToString("X"));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.sp_loadsize = {0}", BitConverter.ToInt32(sp_loadsize, 0));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.sp_entry_address = 0x{0}", BitConverter.ToInt32(sp_entry_address, 0).ToString("X"));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.sp_work_ram_size = {0}", BitConverter.ToInt32(sp_work_ram_size, 0));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.release_date = \"{0}\"", Encoding.ASCII.GetString(release_date));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.release_date2 = \"{0}\"", Encoding.ASCII.GetString(release_date2));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.developer_code = \"{0}\"", Encoding.ASCII.GetString(developer_code));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.domestic_title = \"{0}\"", Encoding.ASCII.GetString(domestic_title));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.overseas_title = \"{0}\"", Encoding.ASCII.GetString(overseas_title));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.product_code = \"{0}\"", Encoding.ASCII.GetString(product_code));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.peripherals = \"{0}\"", Encoding.ASCII.GetString(peripherals));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "segacd_ipbin.region_codes = \"{0}\"", Encoding.ASCII.GetString(region_codes));
|
||||
|
||||
// Decoding all data
|
||||
DateTime ipbindate;
|
||||
@@ -531,8 +525,7 @@ namespace DiscImageChef.Plugins
|
||||
{
|
||||
Saturn = true;
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): Found Sega Saturn IP.BIN");
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "Found Sega Saturn IP.BIN");
|
||||
|
||||
IPBinInformation.AppendLine("--------------------------------");
|
||||
IPBinInformation.AppendLine("SEGA IP.BIN INFORMATION:");
|
||||
@@ -565,23 +558,19 @@ namespace DiscImageChef.Plugins
|
||||
Array.Copy(ipbin_sector, 0x050, peripherals, 0, 16); // Supported peripherals, see above
|
||||
Array.Copy(ipbin_sector, 0x060, product_name, 0, 112); // Game name, space-filled
|
||||
|
||||
//if(MainClass.isDebug)
|
||||
//{
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): saturn_ipbin.maker_id = \"{0}\"", Encoding.ASCII.GetString(maker_id));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): saturn_ipbin.product_no = \"{0}\"", Encoding.ASCII.GetString(product_no));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): saturn_ipbin.product_version = \"{0}\"", Encoding.ASCII.GetString(product_version));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): saturn_ipbin.release_datedate = \"{0}\"", Encoding.ASCII.GetString(release_date));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): saturn_ipbin.saturn_media = \"{0}\"", Encoding.ASCII.GetString(saturn_media));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): saturn_ipbin.disc_no = {0}", Encoding.ASCII.GetString(disc_no));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): saturn_ipbin.disc_no_separator = \"{0}\"", Encoding.ASCII.GetString(disc_no_separator));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): saturn_ipbin.disc_total_nos = {0}", Encoding.ASCII.GetString(disc_total_nos));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): saturn_ipbin.release_date = \"{0}\"", Encoding.ASCII.GetString(release_date));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): saturn_ipbin.spare_space1 = \"{0}\"", Encoding.ASCII.GetString(spare_space1));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): saturn_ipbin.region_codes = \"{0}\"", Encoding.ASCII.GetString(region_codes));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): saturn_ipbin.peripherals = \"{0}\"", Encoding.ASCII.GetString(peripherals));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): saturn_ipbin.product_name = \"{0}\"", Encoding.ASCII.GetString(product_name));
|
||||
//}
|
||||
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "saturn_ipbin.maker_id = \"{0}\"", Encoding.ASCII.GetString(maker_id));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "saturn_ipbin.product_no = \"{0}\"", Encoding.ASCII.GetString(product_no));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "saturn_ipbin.product_version = \"{0}\"", Encoding.ASCII.GetString(product_version));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "saturn_ipbin.release_datedate = \"{0}\"", Encoding.ASCII.GetString(release_date));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "saturn_ipbin.saturn_media = \"{0}\"", Encoding.ASCII.GetString(saturn_media));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "saturn_ipbin.disc_no = {0}", Encoding.ASCII.GetString(disc_no));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "saturn_ipbin.disc_no_separator = \"{0}\"", Encoding.ASCII.GetString(disc_no_separator));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "saturn_ipbin.disc_total_nos = {0}", Encoding.ASCII.GetString(disc_total_nos));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "saturn_ipbin.release_date = \"{0}\"", Encoding.ASCII.GetString(release_date));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "saturn_ipbin.spare_space1 = \"{0}\"", Encoding.ASCII.GetString(spare_space1));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "saturn_ipbin.region_codes = \"{0}\"", Encoding.ASCII.GetString(region_codes));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "saturn_ipbin.peripherals = \"{0}\"", Encoding.ASCII.GetString(peripherals));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "saturn_ipbin.product_name = \"{0}\"", Encoding.ASCII.GetString(product_name));
|
||||
|
||||
// Decoding all data
|
||||
DateTime ipbindate;
|
||||
@@ -654,8 +643,7 @@ namespace DiscImageChef.Plugins
|
||||
{
|
||||
Dreamcast = true;
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): Found Sega Dreamcast IP.BIN");
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "Found Sega Dreamcast IP.BIN");
|
||||
|
||||
IPBinInformation.AppendLine("--------------------------------");
|
||||
IPBinInformation.AppendLine("SEGA IP.BIN INFORMATION:");
|
||||
@@ -698,26 +686,23 @@ namespace DiscImageChef.Plugins
|
||||
Array.Copy(ipbin_sector, 0x070, producer, 0, 16); // Game producer, space-filled
|
||||
Array.Copy(ipbin_sector, 0x080, product_name, 0, 128); // Game name, space-filled
|
||||
|
||||
//if(MainClass.isDebug)
|
||||
//{
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): dreamcast_ipbin.maker_id = \"{0}\"", Encoding.ASCII.GetString(maker_id));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): dreamcast_ipbin.dreamcast_crc = 0x{0}", Encoding.ASCII.GetString(dreamcast_crc));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): dreamcast_ipbin.spare_space1 = \"{0}\"", Encoding.ASCII.GetString(spare_space1));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): dreamcast_ipbin.dreamcast_media = \"{0}\"", Encoding.ASCII.GetString(dreamcast_media));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): dreamcast_ipbin.disc_no = {0}", Encoding.ASCII.GetString(disc_no));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): dreamcast_ipbin.disc_no_separator = \"{0}\"", Encoding.ASCII.GetString(disc_no_separator));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): dreamcast_ipbin.disc_total_nos = \"{0}\"", Encoding.ASCII.GetString(disc_total_nos));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): dreamcast_ipbin.spare_space2 = \"{0}\"", Encoding.ASCII.GetString(spare_space2));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): dreamcast_ipbin.region_codes = \"{0}\"", Encoding.ASCII.GetString(region_codes));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): dreamcast_ipbin.peripherals = \"{0}\"", Encoding.ASCII.GetString(peripherals));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): dreamcast_ipbin.product_no = \"{0}\"", Encoding.ASCII.GetString(product_no));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): dreamcast_ipbin.product_version = \"{0}\"", Encoding.ASCII.GetString(product_version));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): dreamcast_ipbin.release_date = \"{0}\"", Encoding.ASCII.GetString(release_date));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): dreamcast_ipbin.spare_space3 = \"{0}\"", Encoding.ASCII.GetString(spare_space3));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): dreamcast_ipbin.boot_filename = \"{0}\"", Encoding.ASCII.GetString(boot_filename));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): dreamcast_ipbin.producer = \"{0}\"", Encoding.ASCII.GetString(producer));
|
||||
Console.WriteLine("DEBUG (ISO9660 Plugin): dreamcast_ipbin.product_name = \"{0}\"", Encoding.ASCII.GetString(product_name));
|
||||
//}
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "dreamcast_ipbin.maker_id = \"{0}\"", Encoding.ASCII.GetString(maker_id));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "dreamcast_ipbin.dreamcast_crc = 0x{0}", Encoding.ASCII.GetString(dreamcast_crc));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "dreamcast_ipbin.spare_space1 = \"{0}\"", Encoding.ASCII.GetString(spare_space1));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "dreamcast_ipbin.dreamcast_media = \"{0}\"", Encoding.ASCII.GetString(dreamcast_media));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "dreamcast_ipbin.disc_no = {0}", Encoding.ASCII.GetString(disc_no));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "dreamcast_ipbin.disc_no_separator = \"{0}\"", Encoding.ASCII.GetString(disc_no_separator));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "dreamcast_ipbin.disc_total_nos = \"{0}\"", Encoding.ASCII.GetString(disc_total_nos));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "dreamcast_ipbin.spare_space2 = \"{0}\"", Encoding.ASCII.GetString(spare_space2));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "dreamcast_ipbin.region_codes = \"{0}\"", Encoding.ASCII.GetString(region_codes));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "dreamcast_ipbin.peripherals = \"{0}\"", Encoding.ASCII.GetString(peripherals));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "dreamcast_ipbin.product_no = \"{0}\"", Encoding.ASCII.GetString(product_no));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "dreamcast_ipbin.product_version = \"{0}\"", Encoding.ASCII.GetString(product_version));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "dreamcast_ipbin.release_date = \"{0}\"", Encoding.ASCII.GetString(release_date));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "dreamcast_ipbin.spare_space3 = \"{0}\"", Encoding.ASCII.GetString(spare_space3));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "dreamcast_ipbin.boot_filename = \"{0}\"", Encoding.ASCII.GetString(boot_filename));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "dreamcast_ipbin.producer = \"{0}\"", Encoding.ASCII.GetString(producer));
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "dreamcast_ipbin.product_name = \"{0}\"", Encoding.ASCII.GetString(product_name));
|
||||
|
||||
// Decoding all data
|
||||
DateTime ipbindate;
|
||||
|
||||
@@ -43,6 +43,9 @@ using DiscImageChef.ImagePlugins;
|
||||
|
||||
// All information by Natalia Portillo
|
||||
// Variable names from Lisa API
|
||||
using DiscImageChef.Console;
|
||||
|
||||
|
||||
namespace DiscImageChef.Plugins
|
||||
{
|
||||
class LisaFS : Plugin
|
||||
@@ -92,8 +95,7 @@ namespace DiscImageChef.Plugins
|
||||
byte[] tag = imagePlugin.ReadSectorTag((ulong)i, SectorTagType.AppleSectorTag);
|
||||
UInt16 fileid = BigEndianBitConverter.ToUInt16(tag, 0x04);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (LisaFS plugin): Sector {0}, file ID 0x{1:X4}", i, fileid);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "Sector {0}, file ID 0x{1:X4}", i, fileid);
|
||||
|
||||
if (fileid == FILEID_MDDF)
|
||||
{
|
||||
@@ -107,18 +109,15 @@ namespace DiscImageChef.Plugins
|
||||
mddf.blocksize = BigEndianBitConverter.ToUInt16(sector, 0x7C);
|
||||
mddf.datasize = BigEndianBitConverter.ToUInt16(sector, 0x7E);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (LisaFS plugin): Current sector = {0}", i);
|
||||
Console.WriteLine("DEBUG (LisaFS plugin): mddf.mddf_block = {0}", mddf.mddf_block);
|
||||
Console.WriteLine("DEBUG (LisaFS plugin): Disk size = {0} sectors", imagePlugin.GetSectors());
|
||||
Console.WriteLine("DEBUG (LisaFS plugin): mddf.vol_size = {0} sectors", mddf.vol_size);
|
||||
Console.WriteLine("DEBUG (LisaFS plugin): mddf.vol_size - 1 = {0}", mddf.volsize_minus_one);
|
||||
Console.WriteLine("DEBUG (LisaFS plugin): mddf.vol_size - mddf.mddf_block -1 = {0}", mddf.volsize_minus_mddf_minus_one);
|
||||
Console.WriteLine("DEBUG (LisaFS plugin): Disk sector = {0} bytes", imagePlugin.GetSectorSize());
|
||||
Console.WriteLine("DEBUG (LisaFS plugin): mddf.blocksize = {0} bytes", mddf.blocksize);
|
||||
Console.WriteLine("DEBUG (LisaFS plugin): mddf.datasize = {0} bytes", mddf.datasize);
|
||||
}
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "Current sector = {0}", i);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.mddf_block = {0}", mddf.mddf_block);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "Disk size = {0} sectors", imagePlugin.GetSectors());
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size = {0} sectors", mddf.vol_size);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size - 1 = {0}", mddf.volsize_minus_one);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size - mddf.mddf_block -1 = {0}", mddf.volsize_minus_mddf_minus_one);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "Disk sector = {0} bytes", imagePlugin.GetSectorSize());
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.blocksize = {0} bytes", mddf.blocksize);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.datasize = {0} bytes", mddf.datasize);
|
||||
|
||||
if (mddf.mddf_block != i)
|
||||
return false;
|
||||
@@ -149,8 +148,7 @@ namespace DiscImageChef.Plugins
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (LisaFS plugin): Exception {0}, {1}, {2}", ex.Message, ex.InnerException, ex.StackTrace);
|
||||
DicConsole.ErrorWriteLine("Exception {0}, {1}, {2}", ex.Message, ex.InnerException, ex.StackTrace);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -181,8 +179,7 @@ namespace DiscImageChef.Plugins
|
||||
byte[] tag = imagePlugin.ReadSectorTag((ulong)i, SectorTagType.AppleSectorTag);
|
||||
UInt16 fileid = BigEndianBitConverter.ToUInt16(tag, 0x04);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (LisaFS plugin): Sector {0}, file ID 0x{1:X4}", i, fileid);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "Sector {0}, file ID 0x{1:X4}", i, fileid);
|
||||
|
||||
if (fileid == FILEID_MDDF)
|
||||
{
|
||||
@@ -272,48 +269,45 @@ namespace DiscImageChef.Plugins
|
||||
mddf.vol_sequence = BigEndianBitConverter.ToUInt16(sector, 0x136);
|
||||
mddf.vol_left_mounted = sector[0x138];
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("mddf.unknown1 = 0x{0:X2} ({0})", mddf.unknown1);
|
||||
Console.WriteLine("mddf.unknown2 = 0x{0:X2} ({0})", mddf.unknown2);
|
||||
Console.WriteLine("mddf.unknown3 = 0x{0:X8} ({0})", mddf.unknown3);
|
||||
Console.WriteLine("mddf.unknown4 = 0x{0:X4} ({0})", mddf.unknown4);
|
||||
Console.WriteLine("mddf.unknown5 = 0x{0:X8} ({0})", mddf.unknown5);
|
||||
Console.WriteLine("mddf.unknown6 = 0x{0:X8} ({0})", mddf.unknown6);
|
||||
Console.WriteLine("mddf.unknown7 = 0x{0:X8} ({0})", mddf.unknown7);
|
||||
Console.WriteLine("mddf.unknown8 = 0x{0:X8} ({0})", mddf.unknown8);
|
||||
Console.WriteLine("mddf.unknown9 = 0x{0:X8} ({0})", mddf.unknown9);
|
||||
Console.WriteLine("mddf.unknown10 = 0x{0:X8} ({0})", mddf.unknown10);
|
||||
Console.WriteLine("mddf.unknown11 = 0x{0:X8} ({0})", mddf.unknown11);
|
||||
Console.WriteLine("mddf.unknown12 = 0x{0:X8} ({0})", mddf.unknown12);
|
||||
Console.WriteLine("mddf.unknown13 = 0x{0:X8} ({0})", mddf.unknown13);
|
||||
Console.WriteLine("mddf.unknown14 = 0x{0:X8} ({0})", mddf.unknown14);
|
||||
Console.WriteLine("mddf.unknown15 = 0x{0:X8} ({0})", mddf.unknown15);
|
||||
Console.WriteLine("mddf.unknown16 = 0x{0:X8} ({0})", mddf.unknown16);
|
||||
Console.WriteLine("mddf.unknown17 = 0x{0:X4} ({0})", mddf.unknown17);
|
||||
Console.WriteLine("mddf.unknown18 = 0x{0:X8} ({0})", mddf.unknown18);
|
||||
Console.WriteLine("mddf.unknown19 = 0x{0:X8} ({0})", mddf.unknown19);
|
||||
Console.WriteLine("mddf.unknown20 = 0x{0:X8} ({0})", mddf.unknown20);
|
||||
Console.WriteLine("mddf.unknown21 = 0x{0:X8} ({0})", mddf.unknown21);
|
||||
Console.WriteLine("mddf.unknown22 = 0x{0:X8} ({0})", mddf.unknown22);
|
||||
Console.WriteLine("mddf.unknown23 = 0x{0:X8} ({0})", mddf.unknown23);
|
||||
Console.WriteLine("mddf.unknown24 = 0x{0:X8} ({0})", mddf.unknown24);
|
||||
Console.WriteLine("mddf.unknown25 = 0x{0:X8} ({0})", mddf.unknown25);
|
||||
Console.WriteLine("mddf.unknown26 = 0x{0:X8} ({0})", mddf.unknown26);
|
||||
Console.WriteLine("mddf.unknown27 = 0x{0:X8} ({0})", mddf.unknown27);
|
||||
Console.WriteLine("mddf.unknown28 = 0x{0:X8} ({0})", mddf.unknown28);
|
||||
Console.WriteLine("mddf.unknown29 = 0x{0:X8} ({0})", mddf.unknown29);
|
||||
Console.WriteLine("mddf.unknown30 = 0x{0:X8} ({0})", mddf.unknown30);
|
||||
Console.WriteLine("mddf.unknown31 = 0x{0:X8} ({0})", mddf.unknown31);
|
||||
Console.WriteLine("mddf.unknown32 = 0x{0:X8} ({0})", mddf.unknown32);
|
||||
Console.WriteLine("mddf.unknown33 = 0x{0:X8} ({0})", mddf.unknown33);
|
||||
Console.WriteLine("mddf.unknown34 = 0x{0:X8} ({0})", mddf.unknown34);
|
||||
Console.WriteLine("mddf.unknown35 = 0x{0:X8} ({0})", mddf.unknown35);
|
||||
Console.WriteLine("mddf.unknown36 = 0x{0:X8} ({0})", mddf.unknown36);
|
||||
Console.WriteLine("mddf.unknown37 = 0x{0:X8} ({0})", mddf.unknown37);
|
||||
Console.WriteLine("mddf.unknown38 = 0x{0:X8} ({0})", mddf.unknown38);
|
||||
Console.WriteLine("mddf.unknown_timestamp = 0x{0:X8} ({0}, {1})", mddf.unknown_timestamp, DateHandlers.LisaToDateTime(mddf.unknown_timestamp));
|
||||
}
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown1 = 0x{0:X2} ({0})", mddf.unknown1);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown2 = 0x{0:X2} ({0})", mddf.unknown2);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown3 = 0x{0:X8} ({0})", mddf.unknown3);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown4 = 0x{0:X4} ({0})", mddf.unknown4);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown5 = 0x{0:X8} ({0})", mddf.unknown5);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown6 = 0x{0:X8} ({0})", mddf.unknown6);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown7 = 0x{0:X8} ({0})", mddf.unknown7);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown8 = 0x{0:X8} ({0})", mddf.unknown8);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown9 = 0x{0:X8} ({0})", mddf.unknown9);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown10 = 0x{0:X8} ({0})", mddf.unknown10);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown11 = 0x{0:X8} ({0})", mddf.unknown11);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown12 = 0x{0:X8} ({0})", mddf.unknown12);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown13 = 0x{0:X8} ({0})", mddf.unknown13);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown14 = 0x{0:X8} ({0})", mddf.unknown14);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown15 = 0x{0:X8} ({0})", mddf.unknown15);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown16 = 0x{0:X8} ({0})", mddf.unknown16);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown17 = 0x{0:X4} ({0})", mddf.unknown17);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown18 = 0x{0:X8} ({0})", mddf.unknown18);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown19 = 0x{0:X8} ({0})", mddf.unknown19);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown20 = 0x{0:X8} ({0})", mddf.unknown20);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown21 = 0x{0:X8} ({0})", mddf.unknown21);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown22 = 0x{0:X8} ({0})", mddf.unknown22);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown23 = 0x{0:X8} ({0})", mddf.unknown23);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown24 = 0x{0:X8} ({0})", mddf.unknown24);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown25 = 0x{0:X8} ({0})", mddf.unknown25);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown26 = 0x{0:X8} ({0})", mddf.unknown26);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown27 = 0x{0:X8} ({0})", mddf.unknown27);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown28 = 0x{0:X8} ({0})", mddf.unknown28);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown29 = 0x{0:X8} ({0})", mddf.unknown29);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown30 = 0x{0:X8} ({0})", mddf.unknown30);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown31 = 0x{0:X8} ({0})", mddf.unknown31);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown32 = 0x{0:X8} ({0})", mddf.unknown32);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown33 = 0x{0:X8} ({0})", mddf.unknown33);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown34 = 0x{0:X8} ({0})", mddf.unknown34);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown35 = 0x{0:X8} ({0})", mddf.unknown35);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown36 = 0x{0:X8} ({0})", mddf.unknown36);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown37 = 0x{0:X8} ({0})", mddf.unknown37);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown38 = 0x{0:X8} ({0})", mddf.unknown38);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown_timestamp = 0x{0:X8} ({0}, {1})", mddf.unknown_timestamp, DateHandlers.LisaToDateTime(mddf.unknown_timestamp));
|
||||
|
||||
if (mddf.mddf_block != i)
|
||||
return;
|
||||
@@ -400,8 +394,7 @@ namespace DiscImageChef.Plugins
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (LisaFS plugin): Exception {0}, {1}, {2}", ex.Message, ex.InnerException, ex.StackTrace);
|
||||
DicConsole.ErrorWriteLine("Exception {0}, {1}, {2}", ex.Message, ex.InnerException, ex.StackTrace);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,9 @@ using System.Text;
|
||||
using DiscImageChef;
|
||||
|
||||
// Information from Apple ProDOS 8 Technical Reference
|
||||
using DiscImageChef.Console;
|
||||
|
||||
|
||||
namespace DiscImageChef.Plugins
|
||||
{
|
||||
public class ProDOSPlugin : Plugin
|
||||
@@ -156,13 +159,12 @@ namespace DiscImageChef.Plugins
|
||||
year += 1900;
|
||||
if (year < 1940)
|
||||
year += 100;
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (ProDOS plugin): temp_timestamp_left = 0x{0:X4}", temp_timestamp_left);
|
||||
Console.WriteLine("DEBUG (ProDOS plugin): temp_timestamp_right = 0x{0:X4}", temp_timestamp_right);
|
||||
Console.WriteLine("DEBUG (ProDOS plugin): temp_timestamp = 0x{0:X8}", temp_timestamp);
|
||||
Console.WriteLine("DEBUG (ProDOS plugin): Datetime field year {0}, month {1}, day {2}, hour {3}, minute {4}.", year, month, day, hour, minute);
|
||||
}
|
||||
|
||||
DicConsole.DebugWriteLine("ProDOS plugin", "temp_timestamp_left = 0x{0:X4}", temp_timestamp_left);
|
||||
DicConsole.DebugWriteLine("ProDOS plugin", "temp_timestamp_right = 0x{0:X4}", temp_timestamp_right);
|
||||
DicConsole.DebugWriteLine("ProDOS plugin", "temp_timestamp = 0x{0:X8}", temp_timestamp);
|
||||
DicConsole.DebugWriteLine("ProDOS plugin", "Datetime field year {0}, month {1}, day {2}, hour {3}, minute {4}.", year, month, day, hour, minute);
|
||||
|
||||
rootDirectoryKeyBlock.header.creation_time = new DateTime(year, month, day, hour, minute, 0);
|
||||
|
||||
rootDirectoryKeyBlock.header.version = rootDirectoryKeyBlockBytes[0x20];
|
||||
@@ -210,11 +212,8 @@ namespace DiscImageChef.Plugins
|
||||
if ((rootDirectoryKeyBlock.header.access & ProDOSBackupAttribute) == ProDOSBackupAttribute)
|
||||
sbInformation.AppendLine("Volume must be backed up");
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
if ((rootDirectoryKeyBlock.header.access & ProDOSReservedAttributeMask) != 0)
|
||||
sbInformation.AppendFormat("DEBUG(ProDOS plugin): Reserved attributes are set: {0:X2}", rootDirectoryKeyBlock.header.access).AppendLine();
|
||||
}
|
||||
DicConsole.DebugWriteLine("ProDOS plugin", "Reserved attributes are set: {0:X2}", rootDirectoryKeyBlock.header.access);
|
||||
|
||||
information = sbInformation.ToString();
|
||||
|
||||
|
||||
@@ -41,6 +41,9 @@ using System.Text;
|
||||
using DiscImageChef;
|
||||
|
||||
// Based on FAT's BPB, cannot find a FAT or directory
|
||||
using DiscImageChef.Console;
|
||||
|
||||
|
||||
namespace DiscImageChef.Plugins
|
||||
{
|
||||
class SolarFS : Plugin
|
||||
@@ -100,8 +103,6 @@ namespace DiscImageChef.Plugins
|
||||
Array.Copy(bpb_sector, 0x35, bpb_strings, 0, 8);
|
||||
BPB.fs_type = StringHandlers.CToString(bpb_strings);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
BPB.x86_jump = new byte[3];
|
||||
Array.Copy(bpb_sector, 0x00, BPB.x86_jump, 0, 3);
|
||||
BPB.unk1 = bpb_sector[0x0D];
|
||||
@@ -110,23 +111,22 @@ namespace DiscImageChef.Plugins
|
||||
Array.Copy(bpb_sector, 0x1B, BPB.unk3, 0, 10);
|
||||
BPB.unk4 = BitConverter.ToUInt32(bpb_sector, 0x26);
|
||||
|
||||
Console.WriteLine("(SolarFS) BPB.x86_jump: 0x{0:X2}{1:X2}{2:X2}", BPB.x86_jump[0], BPB.x86_jump[1], BPB.x86_jump[2]);
|
||||
Console.WriteLine("(SolarFS) BPB.OEMName: \"{0}\"", BPB.OEMName);
|
||||
Console.WriteLine("(SolarFS) BPB.bps: {0}", BPB.bps);
|
||||
Console.WriteLine("(SolarFS) BPB.unk1: 0x{0:X2}", BPB.unk1);
|
||||
Console.WriteLine("(SolarFS) BPB.unk2: 0x{0:X4}", BPB.unk2);
|
||||
Console.WriteLine("(SolarFS) BPB.root_ent: {0}", BPB.root_ent);
|
||||
Console.WriteLine("(SolarFS) BPB.sectors: {0}", BPB.sectors);
|
||||
Console.WriteLine("(SolarFS) BPB.media: 0x{0:X2}", BPB.media);
|
||||
Console.WriteLine("(SolarFS) BPB.spfat: {0}", BPB.spfat);
|
||||
Console.WriteLine("(SolarFS) BPB.sptrk: {0}", BPB.sptrk);
|
||||
Console.WriteLine("(SolarFS) BPB.heads: {0}", BPB.heads);
|
||||
Console.WriteLine("(SolarFS) BPB.unk3: 0x{0:X2}{1:X2}{2:X2}{3:X2}{4:X2}{5:X2}{6:X2}{7:X2}{8:X2}{9:X2}", BPB.unk3[0], BPB.unk3[1], BPB.unk3[2], BPB.unk3[3], BPB.unk3[4], BPB.unk3[5], BPB.unk3[6], BPB.unk3[7], BPB.unk3[8], BPB.unk3[9]);
|
||||
Console.WriteLine("(SolarFS) BPB.signature: 0x{0:X2}", BPB.signature);
|
||||
Console.WriteLine("(SolarFS) BPB.unk4: 0x{0:X8}", BPB.unk4);
|
||||
Console.WriteLine("(SolarFS) BPB.vol_name: \"{0}\"", BPB.vol_name);
|
||||
Console.WriteLine("(SolarFS) BPB.fs_type: \"{0}\"", BPB.fs_type);
|
||||
}
|
||||
DicConsole.DebugWriteLine("SolarFS plugin", "BPB.x86_jump: 0x{0:X2}{1:X2}{2:X2}", BPB.x86_jump[0], BPB.x86_jump[1], BPB.x86_jump[2]);
|
||||
DicConsole.DebugWriteLine("SolarFS plugin", "BPB.OEMName: \"{0}\"", BPB.OEMName);
|
||||
DicConsole.DebugWriteLine("SolarFS plugin", "BPB.bps: {0}", BPB.bps);
|
||||
DicConsole.DebugWriteLine("SolarFS plugin", "BPB.unk1: 0x{0:X2}", BPB.unk1);
|
||||
DicConsole.DebugWriteLine("SolarFS plugin", "BPB.unk2: 0x{0:X4}", BPB.unk2);
|
||||
DicConsole.DebugWriteLine("SolarFS plugin", "BPB.root_ent: {0}", BPB.root_ent);
|
||||
DicConsole.DebugWriteLine("SolarFS plugin", "BPB.sectors: {0}", BPB.sectors);
|
||||
DicConsole.DebugWriteLine("SolarFS plugin", "BPB.media: 0x{0:X2}", BPB.media);
|
||||
DicConsole.DebugWriteLine("SolarFS plugin", "BPB.spfat: {0}", BPB.spfat);
|
||||
DicConsole.DebugWriteLine("SolarFS plugin", "BPB.sptrk: {0}", BPB.sptrk);
|
||||
DicConsole.DebugWriteLine("SolarFS plugin", "BPB.heads: {0}", BPB.heads);
|
||||
DicConsole.DebugWriteLine("SolarFS plugin", "BPB.unk3: 0x{0:X2}{1:X2}{2:X2}{3:X2}{4:X2}{5:X2}{6:X2}{7:X2}{8:X2}{9:X2}", BPB.unk3[0], BPB.unk3[1], BPB.unk3[2], BPB.unk3[3], BPB.unk3[4], BPB.unk3[5], BPB.unk3[6], BPB.unk3[7], BPB.unk3[8], BPB.unk3[9]);
|
||||
DicConsole.DebugWriteLine("SolarFS plugin", "BPB.signature: 0x{0:X2}", BPB.signature);
|
||||
DicConsole.DebugWriteLine("SolarFS plugin", "BPB.unk4: 0x{0:X8}", BPB.unk4);
|
||||
DicConsole.DebugWriteLine("SolarFS plugin", "BPB.vol_name: \"{0}\"", BPB.vol_name);
|
||||
DicConsole.DebugWriteLine("SolarFS plugin", "BPB.fs_type: \"{0}\"", BPB.fs_type);
|
||||
|
||||
sb.AppendLine("Solar_OS filesystem");
|
||||
sb.AppendFormat("Media descriptor: 0x{0:X2}", BPB.media).AppendLine();
|
||||
|
||||
@@ -41,6 +41,9 @@ using System.Text;
|
||||
using DiscImageChef;
|
||||
|
||||
// Information from the Linux kernel
|
||||
using DiscImageChef.Console;
|
||||
|
||||
|
||||
namespace DiscImageChef.Plugins
|
||||
{
|
||||
class BFS : Plugin
|
||||
@@ -87,18 +90,15 @@ namespace DiscImageChef.Plugins
|
||||
Array.Copy(bfs_sb_sector, 0x22, sb_strings, 0, 6);
|
||||
bfs_sb.s_volume = StringHandlers.CToString(sb_strings);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("(BFS) bfs_sb.s_magic: 0x{0:X8}", bfs_sb.s_magic);
|
||||
Console.WriteLine("(BFS) bfs_sb.s_start: 0x{0:X8}", bfs_sb.s_start);
|
||||
Console.WriteLine("(BFS) bfs_sb.s_end: 0x{0:X8}", bfs_sb.s_end);
|
||||
Console.WriteLine("(BFS) bfs_sb.s_from: 0x{0:X8}", bfs_sb.s_from);
|
||||
Console.WriteLine("(BFS) bfs_sb.s_to: 0x{0:X8}", bfs_sb.s_to);
|
||||
Console.WriteLine("(BFS) bfs_sb.s_bfrom: 0x{0:X8}", bfs_sb.s_bfrom);
|
||||
Console.WriteLine("(BFS) bfs_sb.s_bto: 0x{0:X8}", bfs_sb.s_bto);
|
||||
Console.WriteLine("(BFS) bfs_sb.s_fsname: 0x{0}", bfs_sb.s_fsname);
|
||||
Console.WriteLine("(BFS) bfs_sb.s_volume: 0x{0}", bfs_sb.s_volume);
|
||||
}
|
||||
DicConsole.DebugWriteLine("BFS plugin", "bfs_sb.s_magic: 0x{0:X8}", bfs_sb.s_magic);
|
||||
DicConsole.DebugWriteLine("BFS plugin", "bfs_sb.s_start: 0x{0:X8}", bfs_sb.s_start);
|
||||
DicConsole.DebugWriteLine("BFS plugin", "bfs_sb.s_end: 0x{0:X8}", bfs_sb.s_end);
|
||||
DicConsole.DebugWriteLine("BFS plugin", "bfs_sb.s_from: 0x{0:X8}", bfs_sb.s_from);
|
||||
DicConsole.DebugWriteLine("BFS plugin", "bfs_sb.s_to: 0x{0:X8}", bfs_sb.s_to);
|
||||
DicConsole.DebugWriteLine("BFS plugin", "bfs_sb.s_bfrom: 0x{0:X8}", bfs_sb.s_bfrom);
|
||||
DicConsole.DebugWriteLine("BFS plugin", "bfs_sb.s_bto: 0x{0:X8}", bfs_sb.s_bto);
|
||||
DicConsole.DebugWriteLine("BFS plugin", "bfs_sb.s_fsname: 0x{0}", bfs_sb.s_fsname);
|
||||
DicConsole.DebugWriteLine("BFS plugin", "bfs_sb.s_volume: 0x{0}", bfs_sb.s_volume);
|
||||
|
||||
sb.AppendLine("UNIX Boot filesystem");
|
||||
sb.AppendFormat("Volume goes from byte {0} to byte {1}, for {2} bytes", bfs_sb.s_start, bfs_sb.s_end, bfs_sb.s_end - bfs_sb.s_start).AppendLine();
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
2015-10-18 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* PrintHex.cs:
|
||||
* DateHandlers.cs:
|
||||
* DiscImageChef.Helpers.csproj:
|
||||
Added specific console handling for standard, verbose, debug
|
||||
and error outputs.
|
||||
|
||||
2015-10-05 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* PrintHex.cs:
|
||||
|
||||
@@ -37,6 +37,7 @@ Copyright (C) 2011-2014 Claunia.com
|
||||
//$Id$
|
||||
|
||||
using System;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef
|
||||
{
|
||||
@@ -79,62 +80,54 @@ namespace DiscImageChef
|
||||
fourcharvalue[1] = VDDateTime[1];
|
||||
fourcharvalue[2] = VDDateTime[2];
|
||||
fourcharvalue[3] = VDDateTime[3];
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): year = \"{0}\"", StringHandlers.CToString(fourcharvalue));
|
||||
DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "year = \"{0}\"", StringHandlers.CToString(fourcharvalue));
|
||||
if (!Int32.TryParse(StringHandlers.CToString(fourcharvalue), out year))
|
||||
year = 0;
|
||||
// year = Convert.ToInt32(StringHandlers.CToString(fourcharvalue));
|
||||
|
||||
twocharvalue[0] = VDDateTime[4];
|
||||
twocharvalue[1] = VDDateTime[5];
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): month = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "month = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
if (!Int32.TryParse(StringHandlers.CToString(twocharvalue), out month))
|
||||
month = 0;
|
||||
// month = Convert.ToInt32(StringHandlers.CToString(twocharvalue));
|
||||
|
||||
twocharvalue[0] = VDDateTime[6];
|
||||
twocharvalue[1] = VDDateTime[7];
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): day = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "day = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
if (!Int32.TryParse(StringHandlers.CToString(twocharvalue), out day))
|
||||
day = 0;
|
||||
// day = Convert.ToInt32(StringHandlers.CToString(twocharvalue));
|
||||
|
||||
twocharvalue[0] = VDDateTime[8];
|
||||
twocharvalue[1] = VDDateTime[9];
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): hour = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "hour = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
if (!Int32.TryParse(StringHandlers.CToString(twocharvalue), out hour))
|
||||
hour = 0;
|
||||
// hour = Convert.ToInt32(StringHandlers.CToString(twocharvalue));
|
||||
|
||||
twocharvalue[0] = VDDateTime[10];
|
||||
twocharvalue[1] = VDDateTime[11];
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): minute = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "minute = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
if (!Int32.TryParse(StringHandlers.CToString(twocharvalue), out minute))
|
||||
minute = 0;
|
||||
// minute = Convert.ToInt32(StringHandlers.CToString(twocharvalue));
|
||||
|
||||
twocharvalue[0] = VDDateTime[12];
|
||||
twocharvalue[1] = VDDateTime[13];
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): second = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "second = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
if (!Int32.TryParse(StringHandlers.CToString(twocharvalue), out second))
|
||||
second = 0;
|
||||
// second = Convert.ToInt32(StringHandlers.CToString(twocharvalue));
|
||||
|
||||
twocharvalue[0] = VDDateTime[14];
|
||||
twocharvalue[1] = VDDateTime[15];
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): hundredths = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "hundredths = \"{0}\"", StringHandlers.CToString(twocharvalue));
|
||||
if (!Int32.TryParse(StringHandlers.CToString(twocharvalue), out hundredths))
|
||||
hundredths = 0;
|
||||
// hundredths = Convert.ToInt32(StringHandlers.CToString(twocharvalue));
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (ISO9600ToDateTime handler): decodedDT = new DateTime({0}, {1}, {2}, {3}, {4}, {5}, {6}, DateTimeKind.Unspecified);", year, month, day, hour, minute, second, hundredths * 10);
|
||||
DicConsole.DebugWriteLine("ISO9600ToDateTime handler", "decodedDT = new DateTime({0}, {1}, {2}, {3}, {4}, {5}, {6}, DateTimeKind.Unspecified);", year, month, day, hour, minute, second, hundredths * 10);
|
||||
DateTime decodedDT = new DateTime(year, month, day, hour, minute, second, hundredths * 10, DateTimeKind.Unspecified);
|
||||
|
||||
return decodedDT;
|
||||
|
||||
@@ -44,4 +44,10 @@
|
||||
<Compile Include="Swapping.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\DiscImageChef.Console\DiscImageChef.Console.csproj">
|
||||
<Project>{CCAA7AFE-C094-4D82-A66D-630DE8A3F545}</Project>
|
||||
<Name>DiscImageChef.Console</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -36,6 +36,7 @@ Copyright (C) 2011-2014 Claunia.com
|
||||
****************************************************************************/
|
||||
//$Id$
|
||||
using System;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef
|
||||
{
|
||||
@@ -43,7 +44,7 @@ namespace DiscImageChef
|
||||
{
|
||||
public static void PrintHexArray(byte[] array, int width)
|
||||
{
|
||||
Console.WriteLine(ByteArrayToHexArrayString(array, width));
|
||||
DicConsole.WriteLine(ByteArrayToHexArrayString(array, width));
|
||||
}
|
||||
|
||||
public static string ByteArrayToHexArrayString(byte[] array, int width)
|
||||
@@ -63,12 +64,12 @@ namespace DiscImageChef
|
||||
{
|
||||
if (subcounter == 3 )
|
||||
{
|
||||
Console.Write(" ");
|
||||
sb.Append(" ");
|
||||
subcounter = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.Write(" ");
|
||||
sb.Append(" ");
|
||||
subcounter++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,9 @@ using DiscImageChef;
|
||||
|
||||
// Information about structures learnt from Inside Macintosh
|
||||
// Constants from image testing
|
||||
using DiscImageChef.Console;
|
||||
|
||||
|
||||
namespace DiscImageChef.PartPlugins
|
||||
{
|
||||
class AppleMap : PartPlugin
|
||||
@@ -106,8 +109,7 @@ namespace DiscImageChef.PartPlugins
|
||||
{
|
||||
sector_size = 512;
|
||||
APMFromHDDOnCD = true;
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Apple Partition Map Plugin): PM sector size is 512 bytes, but device's 2048");
|
||||
DicConsole.DebugWriteLine("Apple Partition Map plugin", "PM sector size is 512 bytes, but device's 2048");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -42,6 +42,9 @@ using System.Text;
|
||||
using DiscImageChef;
|
||||
|
||||
// Information learnt from XNU source and testing against real disks
|
||||
using DiscImageChef.Console;
|
||||
|
||||
|
||||
namespace DiscImageChef.PartPlugins
|
||||
{
|
||||
class AtariPartitions : PartPlugin
|
||||
@@ -102,35 +105,32 @@ namespace DiscImageChef.PartPlugins
|
||||
table.badLength = BigEndianBitConverter.ToUInt32(sector, 506);
|
||||
table.checksum = BigEndianBitConverter.ToUInt16(sector, 510);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Checksums.SHA1Context sha1Ctx = new Checksums.SHA1Context();
|
||||
sha1Ctx.Init();
|
||||
sha1Ctx.Update(table.boot);
|
||||
Console.WriteLine("DEBUG (Atari plugin): Boot code SHA1: {0}", sha1Ctx.End());
|
||||
DicConsole.DebugWriteLine("Atari partition plugin", "Boot code SHA1: {0}", sha1Ctx.End());
|
||||
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Atari plugin): table.icdEntries[{0}].flag = 0x{1:X2}", i, (table.icdEntries[i].type & 0xFF000000) >> 24);
|
||||
Console.WriteLine("DEBUG (Atari plugin): table.icdEntries[{0}].type = 0x{1:X6}", i, (table.icdEntries[i].type & 0x00FFFFFF));
|
||||
Console.WriteLine("DEBUG (Atari plugin): table.icdEntries[{0}].start = {1}", i, table.icdEntries[i].start);
|
||||
Console.WriteLine("DEBUG (Atari plugin): table.icdEntries[{0}].length = {1}", i, table.icdEntries[i].length);
|
||||
DicConsole.DebugWriteLine("Atari partition plugin", "table.icdEntries[{0}].flag = 0x{1:X2}", i, (table.icdEntries[i].type & 0xFF000000) >> 24);
|
||||
DicConsole.DebugWriteLine("Atari partition plugin", "table.icdEntries[{0}].type = 0x{1:X6}", i, (table.icdEntries[i].type & 0x00FFFFFF));
|
||||
DicConsole.DebugWriteLine("Atari partition plugin", "table.icdEntries[{0}].start = {1}", i, table.icdEntries[i].start);
|
||||
DicConsole.DebugWriteLine("Atari partition plugin", "table.icdEntries[{0}].length = {1}", i, table.icdEntries[i].length);
|
||||
}
|
||||
|
||||
Console.WriteLine("DEBUG (Atari plugin): table.size = {0}", table.size);
|
||||
DicConsole.DebugWriteLine("Atari partition plugin", "table.size = {0}", table.size);
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Atari plugin): table.entries[{0}].flag = 0x{1:X2}", i, (table.entries[i].type & 0xFF000000) >> 24);
|
||||
Console.WriteLine("DEBUG (Atari plugin): table.entries[{0}].type = 0x{1:X6}", i, (table.entries[i].type & 0x00FFFFFF));
|
||||
Console.WriteLine("DEBUG (Atari plugin): table.entries[{0}].start = {1}", i, table.entries[i].start);
|
||||
Console.WriteLine("DEBUG (Atari plugin): table.entries[{0}].length = {1}", i, table.entries[i].length);
|
||||
DicConsole.DebugWriteLine("Atari partition plugin", "table.entries[{0}].flag = 0x{1:X2}", i, (table.entries[i].type & 0xFF000000) >> 24);
|
||||
DicConsole.DebugWriteLine("Atari partition plugin", "table.entries[{0}].type = 0x{1:X6}", i, (table.entries[i].type & 0x00FFFFFF));
|
||||
DicConsole.DebugWriteLine("Atari partition plugin", "table.entries[{0}].start = {1}", i, table.entries[i].start);
|
||||
DicConsole.DebugWriteLine("Atari partition plugin", "table.entries[{0}].length = {1}", i, table.entries[i].length);
|
||||
}
|
||||
|
||||
Console.WriteLine("DEBUG (Atari plugin): table.badStart = {0}", table.badStart);
|
||||
Console.WriteLine("DEBUG (Atari plugin): table.badLength = {0}", table.badLength);
|
||||
Console.WriteLine("DEBUG (Atari plugin): table.checksum = 0x{0:X4}", table.checksum);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Atari partition plugin", "table.badStart = {0}", table.badStart);
|
||||
DicConsole.DebugWriteLine("Atari partition plugin", "table.badLength = {0}", table.badLength);
|
||||
DicConsole.DebugWriteLine("Atari partition plugin", "table.checksum = 0x{0:X4}", table.checksum);
|
||||
|
||||
bool validTable = false;
|
||||
ulong partitionSequence = 0;
|
||||
@@ -144,12 +144,9 @@ namespace DiscImageChef.PartPlugins
|
||||
validTable = true;
|
||||
|
||||
if (table.entries[i].start <= imagePlugin.GetSectors())
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
if ((table.entries[i].start + table.entries[i].length) > imagePlugin.GetSectors())
|
||||
Console.WriteLine("DEBUG (Atari plugin): WARNING: End of partition goes beyond device size");
|
||||
}
|
||||
DicConsole.DebugWriteLine("Atari partition plugin", "WARNING: End of partition goes beyond device size");
|
||||
|
||||
ulong sectorSize = imagePlugin.GetSectorSize();
|
||||
if (sectorSize == 2448 || sectorSize == 2352)
|
||||
@@ -224,12 +221,9 @@ namespace DiscImageChef.PartPlugins
|
||||
{
|
||||
validTable = true;
|
||||
if (extendedTable.entries[j].start <= imagePlugin.GetSectors())
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
if ((extendedTable.entries[j].start + extendedTable.entries[j].length) > imagePlugin.GetSectors())
|
||||
Console.WriteLine("DEBUG (Atari plugin): WARNING: End of partition goes beyond device size");
|
||||
}
|
||||
DicConsole.DebugWriteLine("Atari partition plugin", "WARNING: End of partition goes beyond device size");
|
||||
|
||||
ulong sectorSize = imagePlugin.GetSectorSize();
|
||||
if (sectorSize == 2448 || sectorSize == 2352)
|
||||
@@ -295,12 +289,9 @@ namespace DiscImageChef.PartPlugins
|
||||
type == TypeSwap || type == TypeRAW || type == TypeNetBSD || type == TypeNetBSDSwap)
|
||||
{
|
||||
if (table.icdEntries[i].start <= imagePlugin.GetSectors())
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
if ((table.icdEntries[i].start + table.icdEntries[i].length) > imagePlugin.GetSectors())
|
||||
Console.WriteLine("DEBUG (Atari plugin): WARNING: End of partition goes beyond device size");
|
||||
}
|
||||
DicConsole.DebugWriteLine("Atari partition plugin", "WARNING: End of partition goes beyond device size");
|
||||
|
||||
ulong sectorSize = imagePlugin.GetSectorSize();
|
||||
if (sectorSize == 2448 || sectorSize == 2352)
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
2015-10-18 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* RDB.cs:
|
||||
* Atari.cs:
|
||||
* AppleMap.cs:
|
||||
* DiscImageChef.Partitions.csproj:
|
||||
Added specific console handling for standard, verbose, debug
|
||||
and error outputs.
|
||||
|
||||
2015-10-05 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* MBR.cs:
|
||||
|
||||
@@ -60,5 +60,9 @@
|
||||
<Project>{CC48B324-A532-4A45-87A6-6F91F7141E8D}</Project>
|
||||
<Name>DiscImageChef.Checksums</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\DiscImageChef.Console\DiscImageChef.Console.csproj">
|
||||
<Project>{CCAA7AFE-C094-4D82-A66D-630DE8A3F545}</Project>
|
||||
<Name>DiscImageChef.Console</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -38,6 +38,7 @@ Copyright (C) 2011-2014 Claunia.com
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.PartPlugins
|
||||
{
|
||||
@@ -904,13 +905,11 @@ namespace DiscImageChef.PartPlugins
|
||||
byte[] tmpSector = imagePlugin.ReadSector(RDBBlock);
|
||||
UInt32 magic = BigEndianBitConverter.ToUInt32(tmpSector, 0);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): Possible magic at block {0} is 0x{1:X8}", RDBBlock, magic);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "Possible magic at block {0} is 0x{1:X8}", RDBBlock, magic);
|
||||
|
||||
if (magic == RigidDiskBlockMagic)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): Found RDB magic at block {0}", RDBBlock);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "Found RDB magic at block {0}", RDBBlock);
|
||||
|
||||
foundRDB = true;
|
||||
break;
|
||||
@@ -1001,64 +1000,61 @@ namespace DiscImageChef.PartPlugins
|
||||
RDB.reserved24 = BigEndianBitConverter.ToUInt32(sector, 0xF8);
|
||||
RDB.reserved25 = BigEndianBitConverter.ToUInt32(sector, 0xFC);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.magic = 0x{0:X8}", RDB.magic);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.size = {0} longs, {1} bytes", RDB.size, RDB.size * 4);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.checksum = 0x{0:X8}", RDB.checksum);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.targetID = {0}", RDB.targetID);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.block_size = {0}", RDB.block_size);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.badblock_ptr = {0}", RDB.badblock_ptr);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.partition_ptr = {0}", RDB.partition_ptr);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.fsheader_ptr = {0}", RDB.fsheader_ptr);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.driveinitcode = {0}", RDB.driveinitcode);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved1 = 0x{0:X8}", RDB.reserved1);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved2 = 0x{0:X8}", RDB.reserved2);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved3 = 0x{0:X8}", RDB.reserved3);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved4 = 0x{0:X8}", RDB.reserved4);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved5 = 0x{0:X8}", RDB.reserved5);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved6 = 0x{0:X8}", RDB.reserved6);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.cylinders = {0}", RDB.cylinders);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.spt = {0}", RDB.spt);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.heads = {0}", RDB.heads);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.interleave = {0}", RDB.interleave);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.parking = {0}", RDB.parking);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved7 = 0x{0:X8}", RDB.reserved7);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved8 = 0x{0:X8}", RDB.reserved8);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved9 = 0x{0:X8}", RDB.reserved9);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.writeprecomp = {0}", RDB.writeprecomp);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reducedwrite = {0}", RDB.reducedwrite);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.steprate = {0}", RDB.steprate);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved10 = 0x{0:X8}", RDB.reserved10);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved11 = 0x{0:X8}", RDB.reserved11);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved12 = 0x{0:X8}", RDB.reserved12);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved13 = 0x{0:X8}", RDB.reserved13);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved14 = 0x{0:X8}", RDB.reserved14);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.RDBBlockLow = {0}", RDB.RDBBlockLow);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.RDBBlockHigh = {0}", RDB.RDBBlockHigh);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.LowCylinder = {0}", RDB.LowCylinder);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.HighCylinder = {0}", RDB.HighCylinder);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.CylBlocks = {0}", RDB.CylBlocks);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.AutoParkSeconds = {0}", RDB.AutoParkSeconds);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.HighCylinder = {0}", RDB.HighCylinder);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved15 = 0x{0:X8}", RDB.reserved15);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.diskVendor = \"{0}\"", RDB.diskVendor);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.diskProduct = \"{0}\"", RDB.diskProduct);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.diskRevision = \"{0}\"", RDB.diskRevision);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.controllerVendor = \"{0}\"", RDB.controllerVendor);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.controllerProduct = \"{0}\"", RDB.controllerProduct);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.controllerRevision = \"{0}\"", RDB.controllerRevision);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved16 = 0x{0:X8}", RDB.reserved16);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved17 = 0x{0:X8}", RDB.reserved17);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved18 = 0x{0:X8}", RDB.reserved18);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved19 = 0x{0:X8}", RDB.reserved19);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved20 = 0x{0:X8}", RDB.reserved20);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved21 = 0x{0:X8}", RDB.reserved21);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved22 = 0x{0:X8}", RDB.reserved22);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved23 = 0x{0:X8}", RDB.reserved23);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved24 = 0x{0:X8}", RDB.reserved24);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): RDB.reserved25 = 0x{0:X8}", RDB.reserved25);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.magic = 0x{0:X8}", RDB.magic);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.size = {0} longs, {1} bytes", RDB.size, RDB.size * 4);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.checksum = 0x{0:X8}", RDB.checksum);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.targetID = {0}", RDB.targetID);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.block_size = {0}", RDB.block_size);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.badblock_ptr = {0}", RDB.badblock_ptr);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.partition_ptr = {0}", RDB.partition_ptr);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.fsheader_ptr = {0}", RDB.fsheader_ptr);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.driveinitcode = {0}", RDB.driveinitcode);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved1 = 0x{0:X8}", RDB.reserved1);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved2 = 0x{0:X8}", RDB.reserved2);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved3 = 0x{0:X8}", RDB.reserved3);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved4 = 0x{0:X8}", RDB.reserved4);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved5 = 0x{0:X8}", RDB.reserved5);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved6 = 0x{0:X8}", RDB.reserved6);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.cylinders = {0}", RDB.cylinders);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.spt = {0}", RDB.spt);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.heads = {0}", RDB.heads);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.interleave = {0}", RDB.interleave);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.parking = {0}", RDB.parking);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved7 = 0x{0:X8}", RDB.reserved7);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved8 = 0x{0:X8}", RDB.reserved8);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved9 = 0x{0:X8}", RDB.reserved9);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.writeprecomp = {0}", RDB.writeprecomp);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reducedwrite = {0}", RDB.reducedwrite);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.steprate = {0}", RDB.steprate);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved10 = 0x{0:X8}", RDB.reserved10);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved11 = 0x{0:X8}", RDB.reserved11);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved12 = 0x{0:X8}", RDB.reserved12);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved13 = 0x{0:X8}", RDB.reserved13);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved14 = 0x{0:X8}", RDB.reserved14);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.RDBBlockLow = {0}", RDB.RDBBlockLow);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.RDBBlockHigh = {0}", RDB.RDBBlockHigh);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.LowCylinder = {0}", RDB.LowCylinder);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.HighCylinder = {0}", RDB.HighCylinder);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.CylBlocks = {0}", RDB.CylBlocks);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.AutoParkSeconds = {0}", RDB.AutoParkSeconds);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.HighCylinder = {0}", RDB.HighCylinder);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved15 = 0x{0:X8}", RDB.reserved15);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.diskVendor = \"{0}\"", RDB.diskVendor);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.diskProduct = \"{0}\"", RDB.diskProduct);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.diskRevision = \"{0}\"", RDB.diskRevision);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.controllerVendor = \"{0}\"", RDB.controllerVendor);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.controllerProduct = \"{0}\"", RDB.controllerProduct);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.controllerRevision = \"{0}\"", RDB.controllerRevision);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved16 = 0x{0:X8}", RDB.reserved16);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved17 = 0x{0:X8}", RDB.reserved17);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved18 = 0x{0:X8}", RDB.reserved18);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved19 = 0x{0:X8}", RDB.reserved19);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved20 = 0x{0:X8}", RDB.reserved20);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved21 = 0x{0:X8}", RDB.reserved21);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved22 = 0x{0:X8}", RDB.reserved22);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved23 = 0x{0:X8}", RDB.reserved23);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved24 = 0x{0:X8}", RDB.reserved24);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "RDB.reserved25 = 0x{0:X8}", RDB.reserved25);
|
||||
|
||||
ulong nextBlock;
|
||||
|
||||
@@ -1067,8 +1063,7 @@ namespace DiscImageChef.PartPlugins
|
||||
nextBlock = RDB.badblock_ptr;
|
||||
while (nextBlock != 0xFFFFFFFF)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): Going to block {0} in search of a BadBlock block", nextBlock);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "Going to block {0} in search of a BadBlock block", nextBlock);
|
||||
|
||||
sector = imagePlugin.ReadSector(nextBlock);
|
||||
UInt32 magic = BigEndianBitConverter.ToUInt32(sector, 0);
|
||||
@@ -1076,8 +1071,7 @@ namespace DiscImageChef.PartPlugins
|
||||
if (magic != BadBlockListMagic)
|
||||
break;
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): Found BadBlock block");
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "Found BadBlock block");
|
||||
|
||||
BadBlockList chainEntry = new BadBlockList();
|
||||
chainEntry.magic = BigEndianBitConverter.ToUInt32(sector, 0x00);
|
||||
@@ -1090,23 +1084,19 @@ namespace DiscImageChef.PartPlugins
|
||||
ulong entries = (chainEntry.size - 6) / 2;
|
||||
chainEntry.blockPairs = new BadBlockEntry[entries];
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): chainEntry.magic = 0x{0:X8}", chainEntry.magic);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): chainEntry.size = {0} longs, {1} bytes", chainEntry.size, chainEntry.size * 4);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): chainEntry.checksum = 0x{0:X8}", chainEntry.checksum);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): chainEntry.targetID = {0}", chainEntry.targetID);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): chainEntry.next_ptr = {0}", chainEntry.next_ptr);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): chainEntry.reserved = 0x{0:X8}", chainEntry.reserved);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "chainEntry.magic = 0x{0:X8}", chainEntry.magic);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "chainEntry.size = {0} longs, {1} bytes", chainEntry.size, chainEntry.size * 4);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "chainEntry.checksum = 0x{0:X8}", chainEntry.checksum);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "chainEntry.targetID = {0}", chainEntry.targetID);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "chainEntry.next_ptr = {0}", chainEntry.next_ptr);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "chainEntry.reserved = 0x{0:X8}", chainEntry.reserved);
|
||||
|
||||
for (ulong i = 0; i < entries; i++)
|
||||
{
|
||||
chainEntry.blockPairs[i].badBlock = BigEndianBitConverter.ToUInt32(sector, (int)(0x18 + i * 8 + 0));
|
||||
chainEntry.blockPairs[i].goodBlock = BigEndianBitConverter.ToUInt32(sector, (int)(0x18 + i * 8 + 4));
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): Bad block at {0} replaced with good block at {1}",
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "Bad block at {0} replaced with good block at {1}",
|
||||
chainEntry.blockPairs[i].badBlock, chainEntry.blockPairs[i].goodBlock);
|
||||
}
|
||||
|
||||
@@ -1119,8 +1109,7 @@ namespace DiscImageChef.PartPlugins
|
||||
nextBlock = RDB.partition_ptr;
|
||||
while (nextBlock != 0xFFFFFFFF)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): Going to block {0} in search of a PartitionEntry block", nextBlock);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "Going to block {0} in search of a PartitionEntry block", nextBlock);
|
||||
|
||||
sector = imagePlugin.ReadSector(nextBlock);
|
||||
UInt32 magic = BigEndianBitConverter.ToUInt32(sector, 0);
|
||||
@@ -1128,8 +1117,7 @@ namespace DiscImageChef.PartPlugins
|
||||
if (magic != PartitionBlockMagic)
|
||||
break;
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): Found PartitionEntry block");
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "Found PartitionEntry block");
|
||||
|
||||
PartitionEntry partEntry = new PartitionEntry();
|
||||
partEntry.dosEnvVec = new DOSEnvironmentVector();
|
||||
@@ -1183,57 +1171,53 @@ namespace DiscImageChef.PartPlugins
|
||||
partEntry.dosEnvVec.control = BigEndianBitConverter.ToUInt32(sector, 0xC8);
|
||||
partEntry.dosEnvVec.bootBlocks = BigEndianBitConverter.ToUInt32(sector, 0xCC);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.magic = 0x{0:X8}", partEntry.magic);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.size = {0} longs, {1} bytes", partEntry.size, partEntry.size * 4);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.checksum = 0x{0:X8}", partEntry.checksum);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.targetID = {0}", partEntry.targetID);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.next_ptr = {0}", partEntry.next_ptr);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.flags = 0x{0:X8}", partEntry.flags);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.reserved1 = 0x{0:X8}", partEntry.reserved1);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.reserved2 = 0x{0:X8}", partEntry.reserved2);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.devFlags = 0x{0:X8}", partEntry.devFlags);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.driveNameLen = {0}", partEntry.driveNameLen);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.driveName = \"{0}\"", partEntry.driveName);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.reserved3 = 0x{0:X8}", partEntry.reserved3);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.reserved4 = 0x{0:X8}", partEntry.reserved4);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.reserved5 = 0x{0:X8}", partEntry.reserved5);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.reserved6 = 0x{0:X8}", partEntry.reserved6);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.reserved7 = 0x{0:X8}", partEntry.reserved7);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.reserved8 = 0x{0:X8}", partEntry.reserved8);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.reserved9 = 0x{0:X8}", partEntry.reserved9);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.reserved10 = 0x{0:X8}", partEntry.reserved10);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.reserved11 = 0x{0:X8}", partEntry.reserved11);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.reserved12 = 0x{0:X8}", partEntry.reserved12);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.reserved13 = 0x{0:X8}", partEntry.reserved13);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.reserved14 = 0x{0:X8}", partEntry.reserved14);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.reserved15 = 0x{0:X8}", partEntry.reserved15);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.reserved16 = 0x{0:X8}", partEntry.reserved16);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.reserved17 = 0x{0:X8}", partEntry.reserved17);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.magic = 0x{0:X8}", partEntry.magic);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.size = {0} longs, {1} bytes", partEntry.size, partEntry.size * 4);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.checksum = 0x{0:X8}", partEntry.checksum);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.targetID = {0}", partEntry.targetID);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.next_ptr = {0}", partEntry.next_ptr);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.flags = 0x{0:X8}", partEntry.flags);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.reserved1 = 0x{0:X8}", partEntry.reserved1);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.reserved2 = 0x{0:X8}", partEntry.reserved2);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.devFlags = 0x{0:X8}", partEntry.devFlags);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.driveNameLen = {0}", partEntry.driveNameLen);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.driveName = \"{0}\"", partEntry.driveName);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.reserved3 = 0x{0:X8}", partEntry.reserved3);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.reserved4 = 0x{0:X8}", partEntry.reserved4);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.reserved5 = 0x{0:X8}", partEntry.reserved5);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.reserved6 = 0x{0:X8}", partEntry.reserved6);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.reserved7 = 0x{0:X8}", partEntry.reserved7);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.reserved8 = 0x{0:X8}", partEntry.reserved8);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.reserved9 = 0x{0:X8}", partEntry.reserved9);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.reserved10 = 0x{0:X8}", partEntry.reserved10);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.reserved11 = 0x{0:X8}", partEntry.reserved11);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.reserved12 = 0x{0:X8}", partEntry.reserved12);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.reserved13 = 0x{0:X8}", partEntry.reserved13);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.reserved14 = 0x{0:X8}", partEntry.reserved14);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.reserved15 = 0x{0:X8}", partEntry.reserved15);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.reserved16 = 0x{0:X8}", partEntry.reserved16);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.reserved17 = 0x{0:X8}", partEntry.reserved17);
|
||||
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.size = {0} longs, {1} bytes", partEntry.dosEnvVec.size, partEntry.dosEnvVec.size * 4);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.block_size = {0} longs, {1} bytes", partEntry.dosEnvVec.block_size, partEntry.dosEnvVec.block_size * 4);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.sec_org = 0x{0:X8}", partEntry.dosEnvVec.sec_org);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.surfaces = {0}", partEntry.dosEnvVec.surfaces);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.spb = {0}", partEntry.dosEnvVec.spb);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.bpt = {0}", partEntry.dosEnvVec.bpt);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.reservedblocks = {0}", partEntry.dosEnvVec.reservedblocks);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.prealloc = {0}", partEntry.dosEnvVec.prealloc);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.interleave = {0}", partEntry.dosEnvVec.interleave);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.lowCylinder = {0}", partEntry.dosEnvVec.lowCylinder);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.highCylinder = {0}", partEntry.dosEnvVec.highCylinder);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.numBuffer = {0}", partEntry.dosEnvVec.numBuffer);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.bufMemType = {0}", partEntry.dosEnvVec.bufMemType);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.maxTransfer = {0}", partEntry.dosEnvVec.maxTransfer);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.Mask = 0x{0:X8}", partEntry.dosEnvVec.Mask);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.bootPriority = {0}", partEntry.dosEnvVec.bootPriority);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.dosType = {0}", AmigaDOSTypeToString(partEntry.dosEnvVec.dosType, true));
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.baud = {0}", partEntry.dosEnvVec.baud);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.control = 0x{0:X8}", partEntry.dosEnvVec.control);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): partEntry.dosEnvVec.bootBlocks = {0}", partEntry.dosEnvVec.bootBlocks);
|
||||
|
||||
}
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.size = {0} longs, {1} bytes", partEntry.dosEnvVec.size, partEntry.dosEnvVec.size * 4);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.block_size = {0} longs, {1} bytes", partEntry.dosEnvVec.block_size, partEntry.dosEnvVec.block_size * 4);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.sec_org = 0x{0:X8}", partEntry.dosEnvVec.sec_org);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.surfaces = {0}", partEntry.dosEnvVec.surfaces);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.spb = {0}", partEntry.dosEnvVec.spb);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.bpt = {0}", partEntry.dosEnvVec.bpt);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.reservedblocks = {0}", partEntry.dosEnvVec.reservedblocks);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.prealloc = {0}", partEntry.dosEnvVec.prealloc);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.interleave = {0}", partEntry.dosEnvVec.interleave);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.lowCylinder = {0}", partEntry.dosEnvVec.lowCylinder);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.highCylinder = {0}", partEntry.dosEnvVec.highCylinder);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.numBuffer = {0}", partEntry.dosEnvVec.numBuffer);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.bufMemType = {0}", partEntry.dosEnvVec.bufMemType);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.maxTransfer = {0}", partEntry.dosEnvVec.maxTransfer);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.Mask = 0x{0:X8}", partEntry.dosEnvVec.Mask);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.bootPriority = {0}", partEntry.dosEnvVec.bootPriority);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.dosType = {0}", AmigaDOSTypeToString(partEntry.dosEnvVec.dosType, true));
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.baud = {0}", partEntry.dosEnvVec.baud);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.control = 0x{0:X8}", partEntry.dosEnvVec.control);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.dosEnvVec.bootBlocks = {0}", partEntry.dosEnvVec.bootBlocks);
|
||||
|
||||
PartitionEntries.Add(partEntry);
|
||||
nextBlock = partEntry.next_ptr;
|
||||
@@ -1245,8 +1229,7 @@ namespace DiscImageChef.PartPlugins
|
||||
nextBlock = RDB.fsheader_ptr;
|
||||
while (nextBlock != 0xFFFFFFFF)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): Going to block {0} in search of a FileSystemHeader block", nextBlock);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "Going to block {0} in search of a FileSystemHeader block", nextBlock);
|
||||
|
||||
sector = imagePlugin.ReadSector(nextBlock);
|
||||
UInt32 magic = BigEndianBitConverter.ToUInt32(sector, 0);
|
||||
@@ -1254,8 +1237,7 @@ namespace DiscImageChef.PartPlugins
|
||||
if (magic != FilesystemHeaderMagic)
|
||||
break;
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): Found FileSystemHeader block");
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "Found FileSystemHeader block");
|
||||
|
||||
FileSystemHeader FSHD = new FileSystemHeader();
|
||||
FSHD.dnode = new DeviceNode();
|
||||
@@ -1282,30 +1264,27 @@ namespace DiscImageChef.PartPlugins
|
||||
FSHD.dnode.seglist_ptr = BigEndianBitConverter.ToUInt32(sector, 0x48);
|
||||
FSHD.dnode.global_vec = BigEndianBitConverter.ToUInt32(sector, 0x4C);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.magic = 0x{0:X8}", FSHD.magic);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.size = {0} longs, {1} bytes", FSHD.size, FSHD.size * 4);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.checksum = 0x{0:X8}", FSHD.checksum);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.targetID = {0}", FSHD.targetID);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.next_ptr = {0}", FSHD.next_ptr);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.flags = 0x{0:X8}", FSHD.flags);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.reserved1 = 0x{0:X8}", FSHD.reserved1);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.reserved2 = 0x{0:X8}", FSHD.reserved2);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.dosType = {0}", AmigaDOSTypeToString(FSHD.dosType));
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.version = {0:D2}.{1:D2} (0x{2:X8})", (FSHD.version & 0xFFFF0000) >> 16, FSHD.version & 0xFFFF, FSHD.version);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.patchFlags = 0x{0:X8}", FSHD.patchFlags);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.magic = 0x{0:X8}", FSHD.magic);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.size = {0} longs, {1} bytes", FSHD.size, FSHD.size * 4);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.checksum = 0x{0:X8}", FSHD.checksum);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.targetID = {0}", FSHD.targetID);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.next_ptr = {0}", FSHD.next_ptr);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.flags = 0x{0:X8}", FSHD.flags);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.reserved1 = 0x{0:X8}", FSHD.reserved1);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.reserved2 = 0x{0:X8}", FSHD.reserved2);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.dosType = {0}", AmigaDOSTypeToString(FSHD.dosType));
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.version = {0:D2}.{1:D2} (0x{2:X8})", (FSHD.version & 0xFFFF0000) >> 16, FSHD.version & 0xFFFF, FSHD.version);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.patchFlags = 0x{0:X8}", FSHD.patchFlags);
|
||||
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.dnode.type = {0}", FSHD.dnode.type);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.dnode.task = {0}", FSHD.dnode.task);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.dnode.locked = {0}", FSHD.dnode.locked);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.dnode.handler = {0}", FSHD.dnode.handler);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.dnode.stackSize = {0}", FSHD.dnode.stackSize);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.dnode.priority = {0}", FSHD.dnode.priority);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.dnode.startup = {0}", FSHD.dnode.startup);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.dnode.seglist_ptr = {0}", FSHD.dnode.seglist_ptr);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): FSHD.dnode.global_vec = 0x{0:X8}", FSHD.dnode.global_vec);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.dnode.type = {0}", FSHD.dnode.type);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.dnode.task = {0}", FSHD.dnode.task);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.dnode.locked = {0}", FSHD.dnode.locked);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.dnode.handler = {0}", FSHD.dnode.handler);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.dnode.stackSize = {0}", FSHD.dnode.stackSize);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.dnode.priority = {0}", FSHD.dnode.priority);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.dnode.startup = {0}", FSHD.dnode.startup);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.dnode.seglist_ptr = {0}", FSHD.dnode.seglist_ptr);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.dnode.global_vec = 0x{0:X8}", FSHD.dnode.global_vec);
|
||||
|
||||
nextBlock = FSHD.dnode.seglist_ptr;
|
||||
bool thereAreLoadSegments = false;
|
||||
@@ -1313,8 +1292,7 @@ namespace DiscImageChef.PartPlugins
|
||||
sha1Ctx.Init();
|
||||
while (nextBlock != 0xFFFFFFFF)
|
||||
{
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): Going to block {0} in search of a LoadSegment block", nextBlock);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "Going to block {0} in search of a LoadSegment block", nextBlock);
|
||||
|
||||
sector = imagePlugin.ReadSector(nextBlock);
|
||||
UInt32 magicSeg = BigEndianBitConverter.ToUInt32(sector, 0);
|
||||
@@ -1322,8 +1300,7 @@ namespace DiscImageChef.PartPlugins
|
||||
if (magicSeg != LoadSegMagic)
|
||||
break;
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): Found LoadSegment block");
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "Found LoadSegment block");
|
||||
|
||||
thereAreLoadSegments = true;
|
||||
LoadSegment loadSeg = new LoadSegment();
|
||||
@@ -1335,14 +1312,11 @@ namespace DiscImageChef.PartPlugins
|
||||
loadSeg.loadData = new byte[(loadSeg.size - 5) * 4];
|
||||
Array.Copy(sector, 0x14, loadSeg.loadData, 0, (loadSeg.size - 5) * 4);
|
||||
|
||||
//if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): loadSeg.magic = 0x{0:X8}", loadSeg.magic);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): loadSeg.size = {0} longs, {1} bytes", loadSeg.size, loadSeg.size * 4);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): loadSeg.checksum = 0x{0:X8}", loadSeg.checksum);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): loadSeg.targetID = {0}", loadSeg.targetID);
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): loadSeg.next_ptr = {0}", loadSeg.next_ptr);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "loadSeg.magic = 0x{0:X8}", loadSeg.magic);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "loadSeg.size = {0} longs, {1} bytes", loadSeg.size, loadSeg.size * 4);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "loadSeg.checksum = 0x{0:X8}", loadSeg.checksum);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "loadSeg.targetID = {0}", loadSeg.targetID);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "loadSeg.next_ptr = {0}", loadSeg.next_ptr);
|
||||
|
||||
SegmentEntries.Add(loadSeg);
|
||||
nextBlock = loadSeg.next_ptr;
|
||||
@@ -1352,8 +1326,7 @@ namespace DiscImageChef.PartPlugins
|
||||
if (thereAreLoadSegments)
|
||||
{
|
||||
string loadSegSHA1 = sha1Ctx.End();
|
||||
//if (MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG (Amiga RDB plugin): LoadSegment data SHA1: {0}", loadSegSHA1);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "LoadSegment data SHA1: {0}", loadSegSHA1);
|
||||
}
|
||||
|
||||
FSHDEntries.Add(FSHD);
|
||||
|
||||
@@ -25,6 +25,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.Devices", "Di
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.Interop", "DiscImageChef.Interop\DiscImageChef.Interop.csproj", "{9183F2E0-A879-4F23-9EE3-C6908F1332B2}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.Console", "DiscImageChef.Console\DiscImageChef.Console.csproj", "{CCAA7AFE-C094-4D82-A66D-630DE8A3F545}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x86 = Debug|x86
|
||||
@@ -61,6 +63,10 @@ Global
|
||||
{CC48B324-A532-4A45-87A6-6F91F7141E8D}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{CC48B324-A532-4A45-87A6-6F91F7141E8D}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{CC48B324-A532-4A45-87A6-6F91F7141E8D}.Release|x86.Build.0 = Release|Any CPU
|
||||
{CCAA7AFE-C094-4D82-A66D-630DE8A3F545}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{CCAA7AFE-C094-4D82-A66D-630DE8A3F545}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{CCAA7AFE-C094-4D82-A66D-630DE8A3F545}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{CCAA7AFE-C094-4D82-A66D-630DE8A3F545}.Release|x86.Build.0 = Release|Any CPU
|
||||
{D7016DF2-5A5E-4524-B40D-BA2D59576688}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{D7016DF2-5A5E-4524-B40D-BA2D59576688}.Debug|x86.Build.0 = Debug|Any CPU
|
||||
{D7016DF2-5A5E-4524-B40D-BA2D59576688}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
2015-10-18 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Main.cs:
|
||||
* Plugins.cs:
|
||||
* Commands/Decode.cs:
|
||||
* Commands/Verify.cs:
|
||||
* Commands/Analyze.cs:
|
||||
* Commands/Formats.cs:
|
||||
* Commands/Entropy.cs:
|
||||
* Commands/Compare.cs:
|
||||
* Commands/PrintHex.cs:
|
||||
* Commands/Checksum.cs:
|
||||
* DiscImageChef.csproj:
|
||||
* Commands/DeviceInfo.cs:
|
||||
Added specific console handling for standard, verbose, debug
|
||||
and error outputs.
|
||||
|
||||
2015-10-17 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Commands/DeviceInfo.cs:
|
||||
|
||||
@@ -40,6 +40,7 @@ using System.Collections.Generic;
|
||||
using DiscImageChef.Plugins;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.PartPlugins;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -47,18 +48,15 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
public static void doAnalyze(AnalyzeSubOptions options)
|
||||
{
|
||||
if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("--debug={0}", options.Debug);
|
||||
Console.WriteLine("--verbose={0}", options.Verbose);
|
||||
Console.WriteLine("--input={0}", options.InputFile);
|
||||
Console.WriteLine("--filesystems={0}", options.SearchForFilesystems);
|
||||
Console.WriteLine("--partitions={0}", options.SearchForPartitions);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Analyze command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Analyze command", "--verbose={0}", options.Verbose);
|
||||
DicConsole.DebugWriteLine("Analyze command", "--input={0}", options.InputFile);
|
||||
DicConsole.DebugWriteLine("Analyze command", "--filesystems={0}", options.SearchForFilesystems);
|
||||
DicConsole.DebugWriteLine("Analyze command", "--partitions={0}", options.SearchForPartitions);
|
||||
|
||||
if (!System.IO.File.Exists(options.InputFile))
|
||||
{
|
||||
Console.WriteLine("Specified file does not exist.");
|
||||
DicConsole.WriteLine("Specified file does not exist.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -77,38 +75,35 @@ namespace DiscImageChef.Commands
|
||||
|
||||
if(_imageFormat == null)
|
||||
{
|
||||
Console.WriteLine("Image format not identified, not proceeding with analysis.");
|
||||
DicConsole.WriteLine("Image format not identified, not proceeding with analysis.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(MainClass.isVerbose)
|
||||
Console.WriteLine("Image format identified by {0} ({1}).", _imageFormat.Name, _imageFormat.PluginUUID);
|
||||
if(options.Verbose)
|
||||
DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", _imageFormat.Name, _imageFormat.PluginUUID);
|
||||
else
|
||||
Console.WriteLine("Image format identified by {0}.", _imageFormat.Name);
|
||||
DicConsole.WriteLine("Image format identified by {0}.", _imageFormat.Name);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (!_imageFormat.OpenImage(options.InputFile))
|
||||
{
|
||||
Console.WriteLine("Unable to open image format");
|
||||
Console.WriteLine("No error given");
|
||||
DicConsole.WriteLine("Unable to open image format");
|
||||
DicConsole.WriteLine("No error given");
|
||||
return;
|
||||
}
|
||||
|
||||
if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("DEBUG: Correctly opened image file.");
|
||||
Console.WriteLine("DEBUG: Image without headers is {0} bytes.", _imageFormat.GetImageSize());
|
||||
Console.WriteLine("DEBUG: Image has {0} sectors.", _imageFormat.GetSectors());
|
||||
Console.WriteLine("DEBUG: Image identifies disk type as {0}.", _imageFormat.GetDiskType());
|
||||
}
|
||||
DicConsole.DebugWriteLine("Analyze command", "Correctly opened image file.");
|
||||
DicConsole.DebugWriteLine("Analyze command", "Image without headers is {0} bytes.", _imageFormat.GetImageSize());
|
||||
DicConsole.DebugWriteLine("Analyze command", "Image has {0} sectors.", _imageFormat.GetSectors());
|
||||
DicConsole.DebugWriteLine("Analyze command", "Image identifies disk type as {0}.", _imageFormat.GetDiskType());
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine("Unable to open image format");
|
||||
Console.WriteLine("Error: {0}", ex.Message);
|
||||
System.Console.Error.WriteLine("Unable to open image format");
|
||||
DicConsole.ErrorWriteLine("Error: {0}", ex.Message);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -138,58 +133,57 @@ namespace DiscImageChef.Commands
|
||||
|
||||
if (partition_scheme == "")
|
||||
{
|
||||
if(MainClass.isDebug)
|
||||
Console.WriteLine("DEBUG: No partitions found");
|
||||
DicConsole.DebugWriteLine("Analyze command", "No partitions found");
|
||||
if (!options.SearchForFilesystems)
|
||||
{
|
||||
Console.WriteLine("No partitions founds, not searching for filesystems");
|
||||
DicConsole.WriteLine("No partitions founds, not searching for filesystems");
|
||||
return;
|
||||
}
|
||||
checkraw = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("Partition scheme identified as {0}", partition_scheme);
|
||||
Console.WriteLine("{0} partitions found.", partitions.Count);
|
||||
DicConsole.WriteLine("Partition scheme identified as {0}", partition_scheme);
|
||||
DicConsole.WriteLine("{0} partitions found.", partitions.Count);
|
||||
|
||||
for (int i = 0; i < partitions.Count; i++)
|
||||
{
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Partition {0}:", partitions[i].PartitionSequence);
|
||||
Console.WriteLine("Partition name: {0}", partitions[i].PartitionName);
|
||||
Console.WriteLine("Partition type: {0}", partitions[i].PartitionType);
|
||||
Console.WriteLine("Partition start: sector {0}, byte {1}", partitions[i].PartitionStartSector, partitions[i].PartitionStart);
|
||||
Console.WriteLine("Partition length: {0} sectors, {1} bytes", partitions[i].PartitionSectors, partitions[i].PartitionLength);
|
||||
Console.WriteLine("Partition description:");
|
||||
Console.WriteLine(partitions[i].PartitionDescription);
|
||||
DicConsole.WriteLine();
|
||||
DicConsole.WriteLine("Partition {0}:", partitions[i].PartitionSequence);
|
||||
DicConsole.WriteLine("Partition name: {0}", partitions[i].PartitionName);
|
||||
DicConsole.WriteLine("Partition type: {0}", partitions[i].PartitionType);
|
||||
DicConsole.WriteLine("Partition start: sector {0}, byte {1}", partitions[i].PartitionStartSector, partitions[i].PartitionStart);
|
||||
DicConsole.WriteLine("Partition length: {0} sectors, {1} bytes", partitions[i].PartitionSectors, partitions[i].PartitionLength);
|
||||
DicConsole.WriteLine("Partition description:");
|
||||
DicConsole.WriteLine(partitions[i].PartitionDescription);
|
||||
|
||||
if (options.SearchForFilesystems)
|
||||
{
|
||||
Console.WriteLine("Identifying filesystem on partition");
|
||||
DicConsole.WriteLine("Identifying filesystem on partition");
|
||||
|
||||
IdentifyFilesystems(_imageFormat, out id_plugins, partitions[i].PartitionStartSector, partitions[i].PartitionStartSector+partitions[i].PartitionSectors);
|
||||
if (id_plugins.Count == 0)
|
||||
Console.WriteLine("Filesystem not identified");
|
||||
DicConsole.WriteLine("Filesystem not identified");
|
||||
else if (id_plugins.Count > 1)
|
||||
{
|
||||
Console.WriteLine(String.Format("Identified by {0} plugins", id_plugins.Count));
|
||||
DicConsole.WriteLine(String.Format("Identified by {0} plugins", id_plugins.Count));
|
||||
|
||||
foreach (string plugin_name in id_plugins)
|
||||
{
|
||||
if (plugins.PluginsList.TryGetValue(plugin_name, out _plugin))
|
||||
{
|
||||
Console.WriteLine(String.Format("As identified by {0}.", _plugin.Name));
|
||||
DicConsole.WriteLine(String.Format("As identified by {0}.", _plugin.Name));
|
||||
_plugin.GetInformation(_imageFormat, partitions[i].PartitionStartSector, partitions[i].PartitionStartSector+partitions[i].PartitionSectors, out information);
|
||||
Console.Write(information);
|
||||
DicConsole.Write(information);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
plugins.PluginsList.TryGetValue(id_plugins[0], out _plugin);
|
||||
Console.WriteLine(String.Format("Identified by {0}.", _plugin.Name));
|
||||
DicConsole.WriteLine(String.Format("Identified by {0}.", _plugin.Name));
|
||||
_plugin.GetInformation(_imageFormat, partitions[i].PartitionStartSector, partitions[i].PartitionStartSector+partitions[i].PartitionSectors, out information);
|
||||
Console.Write(information);
|
||||
DicConsole.Write(information);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -200,35 +194,34 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
IdentifyFilesystems(_imageFormat, out id_plugins, 0, _imageFormat.GetSectors()-1);
|
||||
if (id_plugins.Count == 0)
|
||||
Console.WriteLine("Filesystem not identified");
|
||||
DicConsole.WriteLine("Filesystem not identified");
|
||||
else if (id_plugins.Count > 1)
|
||||
{
|
||||
Console.WriteLine(String.Format("Identified by {0} plugins", id_plugins.Count));
|
||||
DicConsole.WriteLine(String.Format("Identified by {0} plugins", id_plugins.Count));
|
||||
|
||||
foreach (string plugin_name in id_plugins)
|
||||
{
|
||||
if (plugins.PluginsList.TryGetValue(plugin_name, out _plugin))
|
||||
{
|
||||
Console.WriteLine(String.Format("As identified by {0}.", _plugin.Name));
|
||||
DicConsole.WriteLine(String.Format("As identified by {0}.", _plugin.Name));
|
||||
_plugin.GetInformation(_imageFormat, 0, _imageFormat.GetSectors()-1, out information);
|
||||
Console.Write(information);
|
||||
DicConsole.Write(information);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
plugins.PluginsList.TryGetValue(id_plugins[0], out _plugin);
|
||||
Console.WriteLine(String.Format("Identified by {0}.", _plugin.Name));
|
||||
DicConsole.WriteLine(String.Format("Identified by {0}.", _plugin.Name));
|
||||
_plugin.GetInformation(_imageFormat, 0, _imageFormat.GetSectors()-1, out information);
|
||||
Console.Write(information);
|
||||
DicConsole.Write(information);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(String.Format("Error reading file: {0}", ex.Message));
|
||||
if (MainClass.isDebug)
|
||||
Console.WriteLine(ex.StackTrace);
|
||||
DicConsole.ErrorWriteLine(String.Format("Error reading file: {0}", ex.Message));
|
||||
DicConsole.DebugWriteLine("Analyze command", ex.StackTrace);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ using System;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.Checksums;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -46,32 +47,28 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
public static void doChecksum(ChecksumSubOptions options)
|
||||
{
|
||||
if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("--debug={0}", options.Debug);
|
||||
Console.WriteLine("--verbose={0}", options.Verbose);
|
||||
Console.WriteLine("--separated-tracks={0}", options.SeparatedTracks);
|
||||
Console.WriteLine("--whole-disc={0}", options.WholeDisc);
|
||||
Console.WriteLine("--input={0}", options.InputFile);
|
||||
Console.WriteLine("--adler32={0}", options.DoAdler32);
|
||||
Console.WriteLine("--crc16={0}", options.DoCRC16);
|
||||
Console.WriteLine("--crc32={0}", options.DoCRC32);
|
||||
Console.WriteLine("--crc64={0}", options.DoCRC64);
|
||||
Console.WriteLine("--md5={0}", options.DoMD5);
|
||||
Console.WriteLine("--ripemd160={0}", options.DoRIPEMD160);
|
||||
Console.WriteLine("--sha1={0}", options.DoSHA1);
|
||||
Console.WriteLine("--sha256={0}", options.DoSHA256);
|
||||
Console.WriteLine("--sha384={0}", options.DoSHA384);
|
||||
Console.WriteLine("--sha512={0}", options.DoSHA512);
|
||||
Console.WriteLine("--spamsum={0}", options.DoSpamSum);
|
||||
}
|
||||
//throw new NotImplementedException("Checksumming not yet implemented.");
|
||||
DicConsole.DebugWriteLine("Checksum command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--verbose={0}", options.Verbose);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--separated-tracks={0}", options.SeparatedTracks);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--whole-disc={0}", options.WholeDisc);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--input={0}", options.InputFile);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--adler32={0}", options.DoAdler32);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--crc16={0}", options.DoCRC16);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--crc32={0}", options.DoCRC32);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--crc64={0}", options.DoCRC64);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--md5={0}", options.DoMD5);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--ripemd160={0}", options.DoRIPEMD160);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--sha1={0}", options.DoSHA1);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--sha256={0}", options.DoSHA256);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--sha384={0}", options.DoSHA384);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--sha512={0}", options.DoSHA512);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--spamsum={0}", options.DoSpamSum);
|
||||
|
||||
ImagePlugin inputFormat = ImageFormat.Detect(options.InputFile);
|
||||
|
||||
if (inputFormat == null)
|
||||
{
|
||||
Console.WriteLine("Unable to recognize image format, not checksumming");
|
||||
DicConsole.ErrorWriteLine("Unable to recognize image format, not checksumming");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -126,11 +123,11 @@ namespace DiscImageChef.Commands
|
||||
ssctxTrack.Init();
|
||||
|
||||
ulong sectors = currentTrack.TrackEndSector - currentTrack.TrackStartSector + 1;
|
||||
Console.WriteLine("Track {0} has {1} sectors", currentTrack.TrackSequence, sectors);
|
||||
DicConsole.WriteLine("Track {0} has {1} sectors", currentTrack.TrackSequence, sectors);
|
||||
|
||||
for (ulong i = currentTrack.TrackStartSector; i <= currentTrack.TrackEndSector; i++)
|
||||
{
|
||||
Console.Write("\rHashing sector {0} of track {1}", i + 1, currentTrack.TrackSequence);
|
||||
DicConsole.Write("\rHashing sector {0} of track {1}", i + 1, currentTrack.TrackSequence);
|
||||
byte[] sector = inputFormat.ReadSector(i, currentTrack.TrackSequence);
|
||||
if (options.DoAdler32)
|
||||
adler32ctxTrack.Update(sector);
|
||||
@@ -160,42 +157,42 @@ namespace DiscImageChef.Commands
|
||||
ssctxTrack.Update(sector);
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
DicConsole.WriteLine();
|
||||
|
||||
if (options.DoAdler32)
|
||||
Console.WriteLine("Track {0}'s Adler-32: 0x{1}", currentTrack.TrackSequence, adler32ctxTrack.End());
|
||||
DicConsole.WriteLine("Track {0}'s Adler-32: 0x{1}", currentTrack.TrackSequence, adler32ctxTrack.End());
|
||||
if (options.DoCRC16)
|
||||
Console.WriteLine("Track {0}'s CRC16: 0x{1}", currentTrack.TrackSequence, crc16ctxTrack.End());
|
||||
DicConsole.WriteLine("Track {0}'s CRC16: 0x{1}", currentTrack.TrackSequence, crc16ctxTrack.End());
|
||||
if (options.DoCRC32)
|
||||
Console.WriteLine("Track {0}'s CRC32: 0x{1}", currentTrack.TrackSequence, crc32ctxTrack.End());
|
||||
DicConsole.WriteLine("Track {0}'s CRC32: 0x{1}", currentTrack.TrackSequence, crc32ctxTrack.End());
|
||||
if (options.DoCRC64)
|
||||
Console.WriteLine("Track {0}'s CRC64 (ECMA): 0x{1}", currentTrack.TrackSequence, crc64ctxTrack.End());
|
||||
DicConsole.WriteLine("Track {0}'s CRC64 (ECMA): 0x{1}", currentTrack.TrackSequence, crc64ctxTrack.End());
|
||||
if (options.DoFletcher16)
|
||||
Console.WriteLine("Track {0}'s Fletcher-16: 0x{1}", currentTrack.TrackSequence, fletcher16ctxTrack.End());
|
||||
DicConsole.WriteLine("Track {0}'s Fletcher-16: 0x{1}", currentTrack.TrackSequence, fletcher16ctxTrack.End());
|
||||
if (options.DoFletcher32)
|
||||
Console.WriteLine("Track {0}'s Fletcher-32: 0x{1}", currentTrack.TrackSequence, fletcher32ctxTrack.End());
|
||||
DicConsole.WriteLine("Track {0}'s Fletcher-32: 0x{1}", currentTrack.TrackSequence, fletcher32ctxTrack.End());
|
||||
if (options.DoMD5)
|
||||
Console.WriteLine("Track {0}'s MD5: {1}", currentTrack.TrackSequence, md5ctxTrack.End());
|
||||
DicConsole.WriteLine("Track {0}'s MD5: {1}", currentTrack.TrackSequence, md5ctxTrack.End());
|
||||
if (options.DoRIPEMD160)
|
||||
Console.WriteLine("Track {0}'s RIPEMD160: {1}", currentTrack.TrackSequence, ripemd160ctxTrack.End());
|
||||
DicConsole.WriteLine("Track {0}'s RIPEMD160: {1}", currentTrack.TrackSequence, ripemd160ctxTrack.End());
|
||||
if (options.DoSHA1)
|
||||
Console.WriteLine("Track {0}'s SHA1: {1}", currentTrack.TrackSequence, sha1ctxTrack.End());
|
||||
DicConsole.WriteLine("Track {0}'s SHA1: {1}", currentTrack.TrackSequence, sha1ctxTrack.End());
|
||||
if (options.DoSHA256)
|
||||
Console.WriteLine("Track {0}'s SHA256: {1}", currentTrack.TrackSequence, sha256ctxTrack.End());
|
||||
DicConsole.WriteLine("Track {0}'s SHA256: {1}", currentTrack.TrackSequence, sha256ctxTrack.End());
|
||||
if (options.DoSHA384)
|
||||
Console.WriteLine("Track {0}'s SHA384: {1}", currentTrack.TrackSequence, sha384ctxTrack.End());
|
||||
DicConsole.WriteLine("Track {0}'s SHA384: {1}", currentTrack.TrackSequence, sha384ctxTrack.End());
|
||||
if (options.DoSHA512)
|
||||
Console.WriteLine("Track {0}'s SHA512: {1}", currentTrack.TrackSequence, sha512ctxTrack.End());
|
||||
DicConsole.WriteLine("Track {0}'s SHA512: {1}", currentTrack.TrackSequence, sha512ctxTrack.End());
|
||||
if (options.DoSpamSum)
|
||||
Console.WriteLine("Track {0}'s SpamSum: {1}", currentTrack.TrackSequence, ssctxTrack.End());
|
||||
DicConsole.WriteLine("Track {0}'s SpamSum: {1}", currentTrack.TrackSequence, ssctxTrack.End());
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (options.Debug)
|
||||
Console.WriteLine("Could not get tracks because {0}", ex.Message);
|
||||
DicConsole.DebugWriteLine("Could not get tracks because {0}", ex.Message);
|
||||
else
|
||||
Console.WriteLine("Unable to get separate tracks, not checksumming them");
|
||||
DicConsole.WriteLine("Unable to get separate tracks, not checksumming them");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,11 +241,11 @@ namespace DiscImageChef.Commands
|
||||
ssctx.Init();
|
||||
|
||||
ulong sectors = inputFormat.GetSectors();
|
||||
Console.WriteLine("Sectors {0}", sectors);
|
||||
DicConsole.WriteLine("Sectors {0}", sectors);
|
||||
|
||||
for (ulong i = 0; i < sectors; i++)
|
||||
{
|
||||
Console.Write("\rHashing sector {0}", i + 1);
|
||||
DicConsole.Write("\rHashing sector {0}", i + 1);
|
||||
byte[] sector = inputFormat.ReadSector(i);
|
||||
if (options.DoAdler32)
|
||||
adler32ctx.Update(sector);
|
||||
@@ -278,34 +275,34 @@ namespace DiscImageChef.Commands
|
||||
ssctx.Update(sector);
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
DicConsole.WriteLine();
|
||||
|
||||
if (options.DoAdler32)
|
||||
Console.WriteLine("Disk's Adler-32: 0x{0}", adler32ctx.End());
|
||||
DicConsole.WriteLine("Disk's Adler-32: 0x{0}", adler32ctx.End());
|
||||
if (options.DoCRC16)
|
||||
Console.WriteLine("Disk's CRC16: 0x{0}", crc16ctx.End());
|
||||
DicConsole.WriteLine("Disk's CRC16: 0x{0}", crc16ctx.End());
|
||||
if (options.DoCRC32)
|
||||
Console.WriteLine("Disk's CRC32: 0x{0}", crc32ctx.End());
|
||||
DicConsole.WriteLine("Disk's CRC32: 0x{0}", crc32ctx.End());
|
||||
if (options.DoCRC64)
|
||||
Console.WriteLine("Disk's CRC64 (ECMA): 0x{0}", crc64ctx.End());
|
||||
DicConsole.WriteLine("Disk's CRC64 (ECMA): 0x{0}", crc64ctx.End());
|
||||
if (options.DoFletcher16)
|
||||
Console.WriteLine("Disk's Fletcher-16: 0x{0}", fletcher16ctx.End());
|
||||
DicConsole.WriteLine("Disk's Fletcher-16: 0x{0}", fletcher16ctx.End());
|
||||
if (options.DoFletcher32)
|
||||
Console.WriteLine("Disk's Fletcher-32: 0x{0}", fletcher32ctx.End());
|
||||
DicConsole.WriteLine("Disk's Fletcher-32: 0x{0}", fletcher32ctx.End());
|
||||
if (options.DoMD5)
|
||||
Console.WriteLine("Disk's MD5: {0}", md5ctx.End());
|
||||
DicConsole.WriteLine("Disk's MD5: {0}", md5ctx.End());
|
||||
if (options.DoRIPEMD160)
|
||||
Console.WriteLine("Disk's RIPEMD160: {0}", ripemd160ctx.End());
|
||||
DicConsole.WriteLine("Disk's RIPEMD160: {0}", ripemd160ctx.End());
|
||||
if (options.DoSHA1)
|
||||
Console.WriteLine("Disk's SHA1: {0}", sha1ctx.End());
|
||||
DicConsole.WriteLine("Disk's SHA1: {0}", sha1ctx.End());
|
||||
if (options.DoSHA256)
|
||||
Console.WriteLine("Disk's SHA256: {0}", sha256ctx.End());
|
||||
DicConsole.WriteLine("Disk's SHA256: {0}", sha256ctx.End());
|
||||
if (options.DoSHA384)
|
||||
Console.WriteLine("Disk's SHA384: {0}", sha384ctx.End());
|
||||
DicConsole.WriteLine("Disk's SHA384: {0}", sha384ctx.End());
|
||||
if (options.DoSHA512)
|
||||
Console.WriteLine("Disk's SHA512: {0}", sha512ctx.End());
|
||||
DicConsole.WriteLine("Disk's SHA512: {0}", sha512ctx.End());
|
||||
if (options.DoSpamSum)
|
||||
Console.WriteLine("Disk's SpamSum: {0}", ssctx.End());
|
||||
DicConsole.WriteLine("Disk's SpamSum: {0}", ssctx.End());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ using System;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -46,23 +47,20 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
public static void doCompare(CompareSubOptions options)
|
||||
{
|
||||
if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("--debug={0}", options.Debug);
|
||||
Console.WriteLine("--verbose={0}", options.Verbose);
|
||||
Console.WriteLine("--input1={0}", options.InputFile1);
|
||||
Console.WriteLine("--input2={0}", options.InputFile2);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Compare command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Compare command", "--verbose={0}", options.Verbose);
|
||||
DicConsole.DebugWriteLine("Compare command", "--input1={0}", options.InputFile1);
|
||||
DicConsole.DebugWriteLine("Compare command", "--input2={0}", options.InputFile2);
|
||||
|
||||
if (!System.IO.File.Exists(options.InputFile1))
|
||||
{
|
||||
Console.WriteLine("Input file 1 does not exist.");
|
||||
System.Console.Error.WriteLine("Input file 1 does not exist.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!System.IO.File.Exists(options.InputFile2))
|
||||
{
|
||||
Console.WriteLine("Input file 2 does not exist.");
|
||||
System.Console.Error.WriteLine("Input file 2 does not exist.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -71,28 +69,28 @@ namespace DiscImageChef.Commands
|
||||
|
||||
if(input1Format == null)
|
||||
{
|
||||
Console.WriteLine("Input file 1 format not identified, not proceeding with comparison.");
|
||||
DicConsole.ErrorWriteLine("Input file 1 format not identified, not proceeding with comparison.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(MainClass.isVerbose)
|
||||
Console.WriteLine("Input file 1 format identified by {0} ({1}).", input1Format.Name, input1Format.PluginUUID);
|
||||
if(options.Verbose)
|
||||
DicConsole.VerboseWriteLine("Input file 1 format identified by {0} ({1}).", input1Format.Name, input1Format.PluginUUID);
|
||||
else
|
||||
Console.WriteLine("Input file 1 format identified by {0}.", input1Format.Name);
|
||||
DicConsole.WriteLine("Input file 1 format identified by {0}.", input1Format.Name);
|
||||
}
|
||||
|
||||
if(input2Format == null)
|
||||
{
|
||||
Console.WriteLine("Input file 2 format not identified, not proceeding with comparison.");
|
||||
DicConsole.ErrorWriteLine("Input file 2 format not identified, not proceeding with comparison.");
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(MainClass.isVerbose)
|
||||
Console.WriteLine("Input file 2 format identified by {0} ({1}).", input2Format.Name, input2Format.PluginUUID);
|
||||
if(options.Verbose)
|
||||
DicConsole.VerboseWriteLine("Input file 2 format identified by {0} ({1}).", input2Format.Name, input2Format.PluginUUID);
|
||||
else
|
||||
Console.WriteLine("Input file 2 format identified by {0}.", input2Format.Name);
|
||||
DicConsole.WriteLine("Input file 2 format identified by {0}.", input2Format.Name);
|
||||
}
|
||||
|
||||
input1Format.OpenImage(options.InputFile1);
|
||||
@@ -100,7 +98,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
if (MainClass.isVerbose)
|
||||
if (options.Verbose)
|
||||
{
|
||||
sb.AppendLine("\tDisc image 1\tDisc image 2");
|
||||
sb.AppendLine("================================");
|
||||
@@ -194,7 +192,7 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
}
|
||||
|
||||
if (MainClass.isVerbose)
|
||||
if (options.Verbose)
|
||||
{
|
||||
sb.AppendFormat("Has partitions?\t{0}\t{1}", image1Info.imageHasPartitions, image2Info.imageHasPartitions).AppendLine();
|
||||
sb.AppendFormat("Has sessions?\t{0}\t{1}", image1Info.imageHasSessions, image2Info.imageHasSessions).AppendLine();
|
||||
@@ -226,150 +224,150 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
}
|
||||
|
||||
Console.WriteLine("Comparing disk image characteristics");
|
||||
DicConsole.WriteLine("Comparing disk image characteristics");
|
||||
|
||||
if (image1Info.imageHasPartitions != image2Info.imageHasPartitions)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Image partitioned status differ");
|
||||
}
|
||||
if (image1Info.imageHasSessions != image2Info.imageHasSessions)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Image session status differ");
|
||||
}
|
||||
if (image1Info.imageSize != image2Info.imageSize)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Image size differ");
|
||||
}
|
||||
if (image1Info.sectors != image2Info.sectors)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Image sectors differ");
|
||||
}
|
||||
if (image1Info.sectorSize != image2Info.sectorSize)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Image sector size differ");
|
||||
}
|
||||
if (image1Info.imageCreationTime != image2Info.imageCreationTime)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Image creation time differ");
|
||||
}
|
||||
if (image1Info.imageLastModificationTime != image2Info.imageLastModificationTime)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Image last modification time differ");
|
||||
}
|
||||
if (image1Info.diskType != image2Info.diskType)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Disk type differ");
|
||||
}
|
||||
if (image1Info.imageVersion != image2Info.imageVersion)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Image version differ");
|
||||
}
|
||||
if (image1Info.imageApplication != image2Info.imageApplication)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Image application differ");
|
||||
}
|
||||
if (image1Info.imageApplicationVersion != image2Info.imageApplicationVersion)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Image application version differ");
|
||||
}
|
||||
if (image1Info.imageCreator != image2Info.imageCreator)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Image creator differ");
|
||||
}
|
||||
if (image1Info.imageName != image2Info.imageName)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Image name differ");
|
||||
}
|
||||
if (image1Info.imageComments != image2Info.imageComments)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Image comments differ");
|
||||
}
|
||||
if (image1Info.diskManufacturer != image2Info.diskManufacturer)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Disk manufacturer differ");
|
||||
}
|
||||
if (image1Info.diskModel != image2Info.diskModel)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Disk model differ");
|
||||
}
|
||||
if (image1Info.diskSerialNumber != image2Info.diskSerialNumber)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Disk serial number differ");
|
||||
}
|
||||
if (image1Info.diskBarcode != image2Info.diskBarcode)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Disk barcode differ");
|
||||
}
|
||||
if (image1Info.diskPartNumber != image2Info.diskPartNumber)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Disk part number differ");
|
||||
}
|
||||
if (image1Info.diskSequence != image2Info.diskSequence)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Disk sequence differ");
|
||||
}
|
||||
if (image1Info.lastDiskSequence != image2Info.lastDiskSequence)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Last disk in sequence differ");
|
||||
}
|
||||
if (image1Info.driveManufacturer != image2Info.driveManufacturer)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Drive manufacturer differ");
|
||||
}
|
||||
if (image1Info.driveModel != image2Info.driveModel)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Drive model differ");
|
||||
}
|
||||
if (image1Info.driveSerialNumber != image2Info.driveSerialNumber)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Drive serial number differ");
|
||||
}
|
||||
|
||||
@@ -378,24 +376,24 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
imagesDiffer = true;
|
||||
leastSectors = image1Info.sectors;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Image 2 has more sectors");
|
||||
}
|
||||
else if (image1Info.sectors > image2Info.sectors)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
leastSectors = image2Info.sectors;
|
||||
if (!MainClass.isVerbose)
|
||||
if (!options.Verbose)
|
||||
sb.AppendLine("Image 1 has more sectors");
|
||||
}
|
||||
else
|
||||
leastSectors = image1Info.sectors;
|
||||
|
||||
Console.WriteLine("Comparing sectors...");
|
||||
DicConsole.WriteLine("Comparing sectors...");
|
||||
|
||||
for (UInt64 sector = 0; sector < leastSectors; sector++)
|
||||
{
|
||||
Console.Write("\rComparing sector {0} of {1}...", sector+1, leastSectors);
|
||||
DicConsole.Write("\rComparing sector {0} of {1}...", sector+1, leastSectors);
|
||||
try
|
||||
{
|
||||
byte[] image1Sector = input1Format.ReadSector(sector);
|
||||
@@ -416,14 +414,14 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
catch{}
|
||||
}
|
||||
Console.WriteLine();
|
||||
DicConsole.WriteLine();
|
||||
|
||||
if (imagesDiffer)
|
||||
sb.AppendLine("Images differ");
|
||||
else
|
||||
sb.AppendLine("Images do not differ");
|
||||
|
||||
Console.WriteLine(sb.ToString());
|
||||
DicConsole.WriteLine(sb.ToString());
|
||||
}
|
||||
|
||||
private static void CompareBytes(out bool different, out bool sameSize, byte[] compareArray1, byte[] compareArray2)
|
||||
|
||||
@@ -37,6 +37,7 @@ Copyright (C) 2011-2014 Claunia.com
|
||||
//$Id$
|
||||
using System;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -44,22 +45,19 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
public static void doDecode(DecodeSubOptions options)
|
||||
{
|
||||
if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("--debug={0}", options.Debug);
|
||||
Console.WriteLine("--verbose={0}", options.Verbose);
|
||||
Console.WriteLine("--input={0}", options.InputFile);
|
||||
Console.WriteLine("--start={0}", options.StartSector);
|
||||
Console.WriteLine("--length={0}", options.Length);
|
||||
Console.WriteLine("--disk-tags={0}", options.DiskTags);
|
||||
Console.WriteLine("--sector-tags={0}", options.SectorTags);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Decode command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Decode command", "--verbose={0}", options.Verbose);
|
||||
DicConsole.DebugWriteLine("Decode command", "--input={0}", options.InputFile);
|
||||
DicConsole.DebugWriteLine("Decode command", "--start={0}", options.StartSector);
|
||||
DicConsole.DebugWriteLine("Decode command", "--length={0}", options.Length);
|
||||
DicConsole.DebugWriteLine("Decode command", "--disk-tags={0}", options.DiskTags);
|
||||
DicConsole.DebugWriteLine("Decode command", "--sector-tags={0}", options.SectorTags);
|
||||
|
||||
ImagePlugin inputFormat = ImageFormat.Detect(options.InputFile);
|
||||
|
||||
if (inputFormat == null)
|
||||
{
|
||||
Console.WriteLine("Unable to recognize image format, not verifying");
|
||||
DicConsole.ErrorWriteLine("Unable to recognize image format, not decoding");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -68,7 +66,7 @@ namespace DiscImageChef.Commands
|
||||
if (options.DiskTags)
|
||||
{
|
||||
if (inputFormat.ImageInfo.readableDiskTags.Count == 0)
|
||||
Console.WriteLine("There are no disk tags in chosen disc image.");
|
||||
DicConsole.WriteLine("There are no disk tags in chosen disc image.");
|
||||
else
|
||||
{
|
||||
foreach (DiskTagType tag in inputFormat.ImageInfo.readableDiskTags)
|
||||
@@ -79,13 +77,13 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
byte[] inquiry = inputFormat.ReadDiskTag(DiskTagType.SCSI_INQUIRY);
|
||||
if (inquiry == null)
|
||||
Console.WriteLine("Error reading SCSI INQUIRY response from disc image");
|
||||
DicConsole.WriteLine("Error reading SCSI INQUIRY response from disc image");
|
||||
else
|
||||
{
|
||||
Console.WriteLine("SCSI INQUIRY command response:");
|
||||
Console.WriteLine("================================================================================");
|
||||
Console.WriteLine(Decoders.SCSI.PrettifySCSIInquiry(inquiry));
|
||||
Console.WriteLine("================================================================================");
|
||||
DicConsole.WriteLine("SCSI INQUIRY command response:");
|
||||
DicConsole.WriteLine("================================================================================");
|
||||
DicConsole.WriteLine(Decoders.SCSI.PrettifySCSIInquiry(inquiry));
|
||||
DicConsole.WriteLine("================================================================================");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -93,13 +91,13 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
byte[] atip = inputFormat.ReadDiskTag(DiskTagType.CD_ATIP);
|
||||
if (atip == null)
|
||||
Console.WriteLine("Error reading CD ATIP from disc image");
|
||||
DicConsole.WriteLine("Error reading CD ATIP from disc image");
|
||||
else
|
||||
{
|
||||
Console.WriteLine("CD ATIP:");
|
||||
Console.WriteLine("================================================================================");
|
||||
Console.WriteLine(Decoders.CD.PrettifyCDATIP(atip));
|
||||
Console.WriteLine("================================================================================");
|
||||
DicConsole.WriteLine("CD ATIP:");
|
||||
DicConsole.WriteLine("================================================================================");
|
||||
DicConsole.WriteLine(Decoders.CD.PrettifyCDATIP(atip));
|
||||
DicConsole.WriteLine("================================================================================");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -107,13 +105,13 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
byte[] fulltoc = inputFormat.ReadDiskTag(DiskTagType.CD_FullTOC);
|
||||
if (fulltoc == null)
|
||||
Console.WriteLine("Error reading CD full TOC from disc image");
|
||||
DicConsole.WriteLine("Error reading CD full TOC from disc image");
|
||||
else
|
||||
{
|
||||
Console.WriteLine("CD full TOC:");
|
||||
Console.WriteLine("================================================================================");
|
||||
Console.WriteLine(Decoders.CD.PrettifyCDFullTOC(fulltoc));
|
||||
Console.WriteLine("================================================================================");
|
||||
DicConsole.WriteLine("CD full TOC:");
|
||||
DicConsole.WriteLine("================================================================================");
|
||||
DicConsole.WriteLine(Decoders.CD.PrettifyCDFullTOC(fulltoc));
|
||||
DicConsole.WriteLine("================================================================================");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -121,13 +119,13 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
byte[] pma = inputFormat.ReadDiskTag(DiskTagType.CD_PMA);
|
||||
if (pma == null)
|
||||
Console.WriteLine("Error reading CD PMA from disc image");
|
||||
DicConsole.WriteLine("Error reading CD PMA from disc image");
|
||||
else
|
||||
{
|
||||
Console.WriteLine("CD PMA:");
|
||||
Console.WriteLine("================================================================================");
|
||||
Console.WriteLine(Decoders.CD.PrettifyCDPMA(pma));
|
||||
Console.WriteLine("================================================================================");
|
||||
DicConsole.WriteLine("CD PMA:");
|
||||
DicConsole.WriteLine("================================================================================");
|
||||
DicConsole.WriteLine(Decoders.CD.PrettifyCDPMA(pma));
|
||||
DicConsole.WriteLine("================================================================================");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -135,13 +133,13 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
byte[] sessioninfo = inputFormat.ReadDiskTag(DiskTagType.CD_SessionInfo);
|
||||
if (sessioninfo == null)
|
||||
Console.WriteLine("Error reading CD session information from disc image");
|
||||
DicConsole.WriteLine("Error reading CD session information from disc image");
|
||||
else
|
||||
{
|
||||
Console.WriteLine("CD session information:");
|
||||
Console.WriteLine("================================================================================");
|
||||
Console.WriteLine(Decoders.CD.PrettifyCDSessionInfo(sessioninfo));
|
||||
Console.WriteLine("================================================================================");
|
||||
DicConsole.WriteLine("CD session information:");
|
||||
DicConsole.WriteLine("================================================================================");
|
||||
DicConsole.WriteLine(Decoders.CD.PrettifyCDSessionInfo(sessioninfo));
|
||||
DicConsole.WriteLine("================================================================================");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -149,13 +147,13 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
byte[] cdtext = inputFormat.ReadDiskTag(DiskTagType.CD_TEXT);
|
||||
if (cdtext == null)
|
||||
Console.WriteLine("Error reading CD-TEXT from disc image");
|
||||
DicConsole.WriteLine("Error reading CD-TEXT from disc image");
|
||||
else
|
||||
{
|
||||
Console.WriteLine("CD-TEXT:");
|
||||
Console.WriteLine("================================================================================");
|
||||
Console.WriteLine(Decoders.CD.PrettifyCDTextLeadIn(cdtext));
|
||||
Console.WriteLine("================================================================================");
|
||||
DicConsole.WriteLine("CD-TEXT:");
|
||||
DicConsole.WriteLine("================================================================================");
|
||||
DicConsole.WriteLine(Decoders.CD.PrettifyCDTextLeadIn(cdtext));
|
||||
DicConsole.WriteLine("================================================================================");
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -163,18 +161,18 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
byte[] toc = inputFormat.ReadDiskTag(DiskTagType.CD_TOC);
|
||||
if (toc == null)
|
||||
Console.WriteLine("Error reading CD TOC from disc image");
|
||||
DicConsole.WriteLine("Error reading CD TOC from disc image");
|
||||
else
|
||||
{
|
||||
Console.WriteLine("CD TOC:");
|
||||
Console.WriteLine("================================================================================");
|
||||
Console.WriteLine(Decoders.CD.PrettifyCDTOC(toc));
|
||||
Console.WriteLine("================================================================================");
|
||||
DicConsole.WriteLine("CD TOC:");
|
||||
DicConsole.WriteLine("================================================================================");
|
||||
DicConsole.WriteLine(Decoders.CD.PrettifyCDTOC(toc));
|
||||
DicConsole.WriteLine("================================================================================");
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
Console.WriteLine("Decoder for disk tag type \"{0}\" not yet implemented, sorry.", tag);
|
||||
DicConsole.WriteLine("Decoder for disk tag type \"{0}\" not yet implemented, sorry.", tag);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -191,14 +189,14 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
if (!UInt64.TryParse(options.Length, out length))
|
||||
{
|
||||
Console.WriteLine("Value \"{0}\" is not a valid number for length.", options.Length);
|
||||
Console.WriteLine("Not decoding sectors tags");
|
||||
DicConsole.WriteLine("Value \"{0}\" is not a valid number for length.", options.Length);
|
||||
DicConsole.WriteLine("Not decoding sectors tags");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (inputFormat.ImageInfo.readableSectorTags.Count == 0)
|
||||
Console.WriteLine("There are no sector tags in chosen disc image.");
|
||||
DicConsole.WriteLine("There are no sector tags in chosen disc image.");
|
||||
else
|
||||
{
|
||||
foreach (SectorTagType tag in inputFormat.ImageInfo.readableSectorTags)
|
||||
@@ -206,7 +204,7 @@ namespace DiscImageChef.Commands
|
||||
switch (tag)
|
||||
{
|
||||
default:
|
||||
Console.WriteLine("Decoder for disk tag type \"{0}\" not yet implemented, sorry.", tag);
|
||||
DicConsole.WriteLine("Decoder for disk tag type \"{0}\" not yet implemented, sorry.", tag);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
using System;
|
||||
using DiscImageChef.Devices;
|
||||
using System.IO;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -45,12 +46,9 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
public static void doDeviceInfo(DeviceInfoSubOptions options)
|
||||
{
|
||||
if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("--debug={0}", options.Debug);
|
||||
Console.WriteLine("--verbose={0}", options.Verbose);
|
||||
Console.WriteLine("--device={0}", options.DevicePath);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Device-Info command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "--verbose={0}", options.Verbose);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "--device={0}", options.DevicePath);
|
||||
|
||||
if (options.DevicePath.Length == 2 && options.DevicePath[1] == ':' &&
|
||||
options.DevicePath[0] != '/' && Char.IsLetter(options.DevicePath[0]))
|
||||
@@ -62,7 +60,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
if (dev.Error)
|
||||
{
|
||||
Console.WriteLine("Error {0} opening device.", dev.LastError);
|
||||
DicConsole.ErrorWriteLine("Error {0} opening device.", dev.LastError);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -73,7 +71,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
if(sense)
|
||||
{
|
||||
Console.WriteLine("SCSI error. Sense decoding not yet implemented.");
|
||||
DicConsole.ErrorWriteLine("SCSI error. Sense decoding not yet implemented.");
|
||||
|
||||
#if DEBUG
|
||||
FileStream senseFs = File.Open("sense.bin", FileMode.OpenOrCreate);
|
||||
@@ -81,9 +79,9 @@ namespace DiscImageChef.Commands
|
||||
#endif
|
||||
}
|
||||
else
|
||||
Console.WriteLine("SCSI OK");
|
||||
DicConsole.WriteLine("SCSI OK");
|
||||
|
||||
Console.WriteLine("{0}", Decoders.SCSI.PrettifySCSIInquiry(inqBuf));
|
||||
DicConsole.WriteLine("{0}", Decoders.SCSI.PrettifySCSIInquiry(inqBuf));
|
||||
|
||||
Structs.AtaErrorRegistersCHS errorRegisters;
|
||||
|
||||
@@ -98,52 +96,48 @@ namespace DiscImageChef.Commands
|
||||
&& errorRegisters.cylinderHigh == 0xEB
|
||||
&& errorRegisters.cylinderLow == 0x14)
|
||||
{
|
||||
Console.WriteLine("ATA error, but ATAPI signature detected.");
|
||||
DicConsole.WriteLine("ATA error, but ATAPI signature detected.");
|
||||
sense = dev.AtapiIdentify(out ataBuf, out errorRegisters);
|
||||
|
||||
if (sense)
|
||||
{
|
||||
Console.WriteLine("ATAPI error");
|
||||
DicConsole.WriteLine("ATAPI error");
|
||||
|
||||
#if DEBUG
|
||||
Console.WriteLine("STATUS = 0x{0:X2}", errorRegisters.status);
|
||||
Console.WriteLine("ERROR = 0x{0:X2}", errorRegisters.error);
|
||||
Console.WriteLine("NSECTOR = 0x{0:X2}", errorRegisters.sectorCount);
|
||||
Console.WriteLine("SECTOR = 0x{0:X2}", errorRegisters.sector);
|
||||
Console.WriteLine("CYLHIGH = 0x{0:X2}", errorRegisters.cylinderHigh);
|
||||
Console.WriteLine("CYLLOW = 0x{0:X2}", errorRegisters.cylinderLow);
|
||||
Console.WriteLine("DEVICE = 0x{0:X2}", errorRegisters.deviceHead);
|
||||
Console.WriteLine("COMMAND = 0x{0:X2}", errorRegisters.command);
|
||||
Console.WriteLine("Error code = {0}", dev.LastError);
|
||||
#endif
|
||||
DicConsole.DebugWriteLine("Device-Info command", "STATUS = 0x{0:X2}", errorRegisters.status);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "ERROR = 0x{0:X2}", errorRegisters.error);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "NSECTOR = 0x{0:X2}", errorRegisters.sectorCount);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "SECTOR = 0x{0:X2}", errorRegisters.sector);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "CYLHIGH = 0x{0:X2}", errorRegisters.cylinderHigh);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "CYLLOW = 0x{0:X2}", errorRegisters.cylinderLow);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "DEVICE = 0x{0:X2}", errorRegisters.deviceHead);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "COMMAND = 0x{0:X2}", errorRegisters.command);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "Error code = {0}", dev.LastError);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("ATAPI OK");
|
||||
Console.WriteLine("{0}", Decoders.ATA.PrettifyIdentifyDevice(ataBuf));
|
||||
DicConsole.WriteLine("ATAPI OK");
|
||||
DicConsole.WriteLine("{0}", Decoders.ATA.PrettifyIdentifyDevice(ataBuf));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("ATA error");
|
||||
DicConsole.WriteLine("ATA error");
|
||||
|
||||
#if DEBUG
|
||||
Console.WriteLine("STATUS = 0x{0:X2}", errorRegisters.status);
|
||||
Console.WriteLine("ERROR = 0x{0:X2}", errorRegisters.error);
|
||||
Console.WriteLine("NSECTOR = 0x{0:X2}", errorRegisters.sectorCount);
|
||||
Console.WriteLine("SECTOR = 0x{0:X2}", errorRegisters.sector);
|
||||
Console.WriteLine("CYLHIGH = 0x{0:X2}", errorRegisters.cylinderHigh);
|
||||
Console.WriteLine("CYLLOW = 0x{0:X2}", errorRegisters.cylinderLow);
|
||||
Console.WriteLine("DEVICE = 0x{0:X2}", errorRegisters.deviceHead);
|
||||
Console.WriteLine("COMMAND = 0x{0:X2}", errorRegisters.command);
|
||||
Console.WriteLine("Error code = {0}", dev.LastError);
|
||||
#endif
|
||||
DicConsole.DebugWriteLine("Device-Info command", "STATUS = 0x{0:X2}", errorRegisters.status);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "ERROR = 0x{0:X2}", errorRegisters.error);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "NSECTOR = 0x{0:X2}", errorRegisters.sectorCount);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "SECTOR = 0x{0:X2}", errorRegisters.sector);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "CYLHIGH = 0x{0:X2}", errorRegisters.cylinderHigh);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "CYLLOW = 0x{0:X2}", errorRegisters.cylinderLow);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "DEVICE = 0x{0:X2}", errorRegisters.deviceHead);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "COMMAND = 0x{0:X2}", errorRegisters.command);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "Error code = {0}", dev.LastError);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("ATA OK");
|
||||
Console.WriteLine("{0}", Decoders.ATA.PrettifyIdentifyDevice(ataBuf));
|
||||
DicConsole.WriteLine("ATA OK");
|
||||
DicConsole.WriteLine("{0}", Decoders.ATA.PrettifyIdentifyDevice(ataBuf));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ using System;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.Checksums;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -46,21 +47,18 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
public static void doEntropy(EntropySubOptions options)
|
||||
{
|
||||
if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("--debug={0}", options.Debug);
|
||||
Console.WriteLine("--verbose={0}", options.Verbose);
|
||||
Console.WriteLine("--separated-tracks={0}", options.SeparatedTracks);
|
||||
Console.WriteLine("--whole-disc={0}", options.WholeDisc);
|
||||
Console.WriteLine("--input={0}", options.InputFile);
|
||||
Console.WriteLine("--duplicated-sectors={0}", options.DuplicatedSectors);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Entropy command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Entropy command", "--verbose={0}", options.Verbose);
|
||||
DicConsole.DebugWriteLine("Entropy command", "--separated-tracks={0}", options.SeparatedTracks);
|
||||
DicConsole.DebugWriteLine("Entropy command", "--whole-disc={0}", options.WholeDisc);
|
||||
DicConsole.DebugWriteLine("Entropy command", "--input={0}", options.InputFile);
|
||||
DicConsole.DebugWriteLine("Entropy command", "--duplicated-sectors={0}", options.DuplicatedSectors);
|
||||
|
||||
ImagePlugin inputFormat = ImageFormat.Detect(options.InputFile);
|
||||
|
||||
if (inputFormat == null)
|
||||
{
|
||||
Console.WriteLine("Unable to recognize image format, not checksumming");
|
||||
DicConsole.ErrorWriteLine("Unable to recognize image format, not checksumming");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -80,11 +78,11 @@ namespace DiscImageChef.Commands
|
||||
List<string> uniqueSectorsPerTrack = new List<string>();
|
||||
|
||||
ulong sectors = currentTrack.TrackEndSector - currentTrack.TrackStartSector + 1;
|
||||
Console.WriteLine("Track {0} has {1} sectors", currentTrack.TrackSequence, sectors);
|
||||
DicConsole.WriteLine("Track {0} has {1} sectors", currentTrack.TrackSequence, sectors);
|
||||
|
||||
for (ulong i = currentTrack.TrackStartSector; i <= currentTrack.TrackEndSector; i++)
|
||||
{
|
||||
Console.Write("\rEntropying sector {0} of track {1}", i + 1, currentTrack.TrackSequence);
|
||||
DicConsole.Write("\rEntropying sector {0} of track {1}", i + 1, currentTrack.TrackSequence);
|
||||
byte[] sector = inputFormat.ReadSector(i, currentTrack.TrackSequence);
|
||||
|
||||
if(options.DuplicatedSectors)
|
||||
@@ -108,20 +106,20 @@ namespace DiscImageChef.Commands
|
||||
entropy += -(frequency * Math.Log(frequency, 2));
|
||||
}
|
||||
|
||||
Console.WriteLine("Entropy for track {0} is {1:F4}.", currentTrack.TrackSequence, entropy);
|
||||
DicConsole.WriteLine("Entropy for track {0} is {1:F4}.", currentTrack.TrackSequence, entropy);
|
||||
|
||||
if(options.DuplicatedSectors)
|
||||
Console.WriteLine("Track {0} has {1} unique sectors ({1:P3})", currentTrack.TrackSequence, uniqueSectorsPerTrack.Count, (double)uniqueSectorsPerTrack.Count/(double)sectors);
|
||||
DicConsole.WriteLine("Track {0} has {1} unique sectors ({1:P3})", currentTrack.TrackSequence, uniqueSectorsPerTrack.Count, (double)uniqueSectorsPerTrack.Count/(double)sectors);
|
||||
|
||||
Console.WriteLine();
|
||||
DicConsole.WriteLine();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (options.Debug)
|
||||
Console.WriteLine("Could not get tracks because {0}", ex.Message);
|
||||
DicConsole.DebugWriteLine("Could not get tracks because {0}", ex.Message);
|
||||
else
|
||||
Console.WriteLine("Unable to get separate tracks, not calculating their entropy");
|
||||
DicConsole.ErrorWriteLine("Unable to get separate tracks, not calculating their entropy");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,13 +132,13 @@ namespace DiscImageChef.Commands
|
||||
List<string> uniqueSectors = new List<string>();
|
||||
|
||||
ulong sectors = inputFormat.GetSectors();
|
||||
Console.WriteLine("Sectors {0}", sectors);
|
||||
DicConsole.WriteLine("Sectors {0}", sectors);
|
||||
|
||||
sha1Ctx.Init();
|
||||
|
||||
for (ulong i = 0; i < sectors; i++)
|
||||
{
|
||||
Console.Write("\rEntropying sector {0}", i + 1);
|
||||
DicConsole.Write("\rEntropying sector {0}", i + 1);
|
||||
byte[] sector = inputFormat.ReadSector(i);
|
||||
|
||||
if(options.DuplicatedSectors)
|
||||
@@ -165,12 +163,12 @@ namespace DiscImageChef.Commands
|
||||
entropy += -(frequency * Math.Log(frequency, 2));
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
DicConsole.WriteLine();
|
||||
|
||||
Console.WriteLine("Entropy for disk is {0:F4}.", entropy);
|
||||
DicConsole.WriteLine("Entropy for disk is {0:F4}.", entropy);
|
||||
|
||||
if(options.DuplicatedSectors)
|
||||
Console.WriteLine("Disk has {0} unique sectors ({1:P3})", uniqueSectors.Count, (double)uniqueSectors.Count/(double)sectors);
|
||||
DicConsole.WriteLine("Disk has {0} unique sectors ({1:P3})", uniqueSectors.Count, (double)uniqueSectors.Count/(double)sectors);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -40,47 +40,48 @@ using System.Collections.Generic;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.PartPlugins;
|
||||
using DiscImageChef.Plugins;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
public static class Formats
|
||||
{
|
||||
public static void ListFormats()
|
||||
public static void ListFormats(FormatsSubOptions FormatsOptions)
|
||||
{
|
||||
PluginBase plugins = new PluginBase();
|
||||
plugins.RegisterAllPlugins();
|
||||
|
||||
Console.WriteLine("Supported disc image formats:");
|
||||
if(MainClass.isVerbose)
|
||||
Console.WriteLine("GUID\t\t\t\t\tPlugin");
|
||||
DicConsole.WriteLine("Supported disc image formats:");
|
||||
if(FormatsOptions.Verbose)
|
||||
DicConsole.VerboseWriteLine("GUID\t\t\t\t\tPlugin");
|
||||
foreach (KeyValuePair<string, ImagePlugin> kvp in plugins.ImagePluginsList)
|
||||
{
|
||||
if(MainClass.isVerbose)
|
||||
Console.WriteLine("{0}\t{1}", kvp.Value.PluginUUID, kvp.Value.Name);
|
||||
if(FormatsOptions.Verbose)
|
||||
DicConsole.VerboseWriteLine("{0}\t{1}", kvp.Value.PluginUUID, kvp.Value.Name);
|
||||
else
|
||||
Console.WriteLine(kvp.Value.Name);
|
||||
DicConsole.WriteLine(kvp.Value.Name);
|
||||
}
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Supported filesystems:");
|
||||
if(MainClass.isVerbose)
|
||||
Console.WriteLine("GUID\t\t\t\t\tPlugin");
|
||||
DicConsole.WriteLine();
|
||||
DicConsole.WriteLine("Supported filesystems:");
|
||||
if(FormatsOptions.Verbose)
|
||||
DicConsole.VerboseWriteLine("GUID\t\t\t\t\tPlugin");
|
||||
foreach (KeyValuePair<string, Plugin> kvp in plugins.PluginsList)
|
||||
{
|
||||
if(MainClass.isVerbose)
|
||||
Console.WriteLine("{0}\t{1}", kvp.Value.PluginUUID, kvp.Value.Name);
|
||||
if(FormatsOptions.Verbose)
|
||||
DicConsole.VerboseWriteLine("{0}\t{1}", kvp.Value.PluginUUID, kvp.Value.Name);
|
||||
else
|
||||
Console.WriteLine(kvp.Value.Name);
|
||||
DicConsole.WriteLine(kvp.Value.Name);
|
||||
}
|
||||
Console.WriteLine();
|
||||
Console.WriteLine("Supported partitioning schemes:");
|
||||
if(MainClass.isVerbose)
|
||||
Console.WriteLine("GUID\t\t\t\t\tPlugin");
|
||||
DicConsole.WriteLine();
|
||||
DicConsole.WriteLine("Supported partitioning schemes:");
|
||||
if(FormatsOptions.Verbose)
|
||||
DicConsole.VerboseWriteLine("GUID\t\t\t\t\tPlugin");
|
||||
foreach (KeyValuePair<string, PartPlugin> kvp in plugins.PartPluginsList)
|
||||
{
|
||||
if(MainClass.isVerbose)
|
||||
Console.WriteLine("{0}\t{1}", kvp.Value.PluginUUID, kvp.Value.Name);
|
||||
if(FormatsOptions.Verbose)
|
||||
DicConsole.VerboseWriteLine("{0}\t{1}", kvp.Value.PluginUUID, kvp.Value.Name);
|
||||
else
|
||||
Console.WriteLine(kvp.Value.Name);
|
||||
DicConsole.WriteLine(kvp.Value.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ Copyright (C) 2011-2014 Claunia.com
|
||||
//$Id$
|
||||
using System;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -44,22 +45,19 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
public static void doPrintHex(PrintHexSubOptions options)
|
||||
{
|
||||
if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("--debug={0}", options.Debug);
|
||||
Console.WriteLine("--verbose={0}", options.Verbose);
|
||||
Console.WriteLine("--input={0}", options.InputFile);
|
||||
Console.WriteLine("--start={0}", options.StartSector);
|
||||
Console.WriteLine("--length={0}", options.Length);
|
||||
Console.WriteLine("--long-sectors={0}", options.LongSectors);
|
||||
Console.WriteLine("--WidthBytes={0}", options.WidthBytes);
|
||||
}
|
||||
DicConsole.DebugWriteLine("PrintHex command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("PrintHex command", "--verbose={0}", options.Verbose);
|
||||
DicConsole.DebugWriteLine("PrintHex command", "--input={0}", options.InputFile);
|
||||
DicConsole.DebugWriteLine("PrintHex command", "--start={0}", options.StartSector);
|
||||
DicConsole.DebugWriteLine("PrintHex command", "--length={0}", options.Length);
|
||||
DicConsole.DebugWriteLine("PrintHex command", "--long-sectors={0}", options.LongSectors);
|
||||
DicConsole.DebugWriteLine("PrintHex command", "--WidthBytes={0}", options.WidthBytes);
|
||||
|
||||
ImagePlugin inputFormat = ImageFormat.Detect(options.InputFile);
|
||||
|
||||
if (inputFormat == null)
|
||||
{
|
||||
Console.WriteLine("Unable to recognize image format, not verifying");
|
||||
DicConsole.ErrorWriteLine("Unable to recognize image format, not verifying");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -67,19 +65,19 @@ namespace DiscImageChef.Commands
|
||||
|
||||
for(ulong i = 0; i < options.Length; i++)
|
||||
{
|
||||
Console.WriteLine("Sector {0}", options.StartSector + i);
|
||||
DicConsole.WriteLine("Sector {0}", options.StartSector + i);
|
||||
byte[] sector;
|
||||
|
||||
if (inputFormat.ImageInfo.readableSectorTags == null)
|
||||
{
|
||||
Console.WriteLine("Requested sectors with tags, unsupported by underlying image format, printing only user data.");
|
||||
DicConsole.WriteLine("Requested sectors with tags, unsupported by underlying image format, printing only user data.");
|
||||
options.LongSectors = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (inputFormat.ImageInfo.readableSectorTags.Count == 0)
|
||||
{
|
||||
Console.WriteLine("Requested sectors with tags, unsupported by underlying image format, printing only user data.");
|
||||
DicConsole.WriteLine("Requested sectors with tags, unsupported by underlying image format, printing only user data.");
|
||||
options.LongSectors = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ Copyright (C) 2011-2014 Claunia.com
|
||||
using System;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -45,20 +46,17 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
public static void doVerify(VerifySubOptions options)
|
||||
{
|
||||
if (MainClass.isDebug)
|
||||
{
|
||||
Console.WriteLine("--debug={0}", options.Debug);
|
||||
Console.WriteLine("--verbose={0}", options.Verbose);
|
||||
Console.WriteLine("--input={0}", options.InputFile);
|
||||
Console.WriteLine("--verify-disc={0}", options.VerifyDisc);
|
||||
Console.WriteLine("--verify-sectors={0}", options.VerifySectors);
|
||||
}
|
||||
DicConsole.DebugWriteLine("Verify command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Verify command", "--verbose={0}", options.Verbose);
|
||||
DicConsole.DebugWriteLine("Verify command", "--input={0}", options.InputFile);
|
||||
DicConsole.DebugWriteLine("Verify command", "--verify-disc={0}", options.VerifyDisc);
|
||||
DicConsole.DebugWriteLine("Verify command", "--verify-sectors={0}", options.VerifySectors);
|
||||
|
||||
ImagePlugin inputFormat = ImageFormat.Detect(options.InputFile);
|
||||
|
||||
if (inputFormat == null)
|
||||
{
|
||||
Console.WriteLine("Unable to recognize image format, not verifying");
|
||||
DicConsole.ErrorWriteLine("Unable to recognize image format, not verifying");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -75,18 +73,17 @@ namespace DiscImageChef.Commands
|
||||
switch (discCheckStatus)
|
||||
{
|
||||
case true:
|
||||
Console.WriteLine("Disc image checksums are correct");
|
||||
DicConsole.WriteLine("Disc image checksums are correct");
|
||||
break;
|
||||
case false:
|
||||
Console.WriteLine("Disc image checksums are incorrect");
|
||||
DicConsole.WriteLine("Disc image checksums are incorrect");
|
||||
break;
|
||||
case null:
|
||||
Console.WriteLine("Disc image does not contain checksums");
|
||||
DicConsole.WriteLine("Disc image does not contain checksums");
|
||||
break;
|
||||
}
|
||||
|
||||
if (MainClass.isVerbose)
|
||||
Console.WriteLine("Checking disc image checksums took {0} seconds", CheckTime.TotalSeconds);
|
||||
DicConsole.VerboseWriteLine("Checking disc image checksums took {0} seconds", CheckTime.TotalSeconds);
|
||||
}
|
||||
|
||||
if (options.VerifySectors)
|
||||
@@ -124,7 +121,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
while (remainingSectors > 0)
|
||||
{
|
||||
Console.Write("\rChecking sector {0} of {1}, on track {2}", currentSectorAll, inputFormat.GetSectors(), currentTrack.TrackSequence);
|
||||
DicConsole.Write("\rChecking sector {0} of {1}, on track {2}", currentSectorAll, inputFormat.GetSectors(), currentTrack.TrackSequence);
|
||||
|
||||
List<UInt64> tempFailingLBAs;
|
||||
List<UInt64> tempUnknownLBAs;
|
||||
@@ -175,7 +172,7 @@ namespace DiscImageChef.Commands
|
||||
StartCheck = DateTime.UtcNow;
|
||||
while (remainingSectors > 0)
|
||||
{
|
||||
Console.Write("\rChecking sector {0} of {1}", currentSector, inputFormat.GetSectors());
|
||||
DicConsole.Write("\rChecking sector {0} of {1}", currentSector, inputFormat.GetSectors());
|
||||
|
||||
List<UInt64> tempFailingLBAs;
|
||||
List<UInt64> tempUnknownLBAs;
|
||||
@@ -218,45 +215,44 @@ namespace DiscImageChef.Commands
|
||||
|
||||
TimeSpan CheckTime = EndCheck - StartCheck;
|
||||
|
||||
Console.Write("\r");
|
||||
DicConsole.Write("\r");
|
||||
|
||||
switch (checkStatus)
|
||||
{
|
||||
case true:
|
||||
Console.WriteLine("All sector checksums are correct");
|
||||
DicConsole.WriteLine("All sector checksums are correct");
|
||||
break;
|
||||
case false:
|
||||
Console.WriteLine("There is at least one sector with incorrect checksum or errors");
|
||||
DicConsole.WriteLine("There is at least one sector with incorrect checksum or errors");
|
||||
break;
|
||||
case null:
|
||||
Console.WriteLine("There is at least one sector that does not contain a checksum");
|
||||
DicConsole.WriteLine("There is at least one sector that does not contain a checksum");
|
||||
break;
|
||||
}
|
||||
|
||||
if (MainClass.isVerbose)
|
||||
Console.WriteLine("Checking sector checksums took {0} seconds", CheckTime.TotalSeconds);
|
||||
DicConsole.VerboseWriteLine("Checking sector checksums took {0} seconds", CheckTime.TotalSeconds);
|
||||
|
||||
if (MainClass.isVerbose)
|
||||
if (options.Verbose)
|
||||
{
|
||||
Console.WriteLine("LBAs with error:");
|
||||
DicConsole.VerboseWriteLine("LBAs with error:");
|
||||
if (FailingLBAs.Count == (int)inputFormat.GetSectors())
|
||||
Console.WriteLine("\tall sectors.");
|
||||
DicConsole.VerboseWriteLine("\tall sectors.");
|
||||
else
|
||||
for (int i = 0; i < FailingLBAs.Count; i++)
|
||||
Console.WriteLine("\t{0}", FailingLBAs[i]);
|
||||
DicConsole.VerboseWriteLine("\t{0}", FailingLBAs[i]);
|
||||
|
||||
Console.WriteLine("LBAs without checksum:");
|
||||
DicConsole.WriteLine("LBAs without checksum:");
|
||||
if (UnknownLBAs.Count == (int)inputFormat.GetSectors())
|
||||
Console.WriteLine("\tall sectors.");
|
||||
DicConsole.VerboseWriteLine("\tall sectors.");
|
||||
else
|
||||
for (int i = 0; i < UnknownLBAs.Count; i++)
|
||||
Console.WriteLine("\t{0}", UnknownLBAs[i]);
|
||||
DicConsole.VerboseWriteLine("\t{0}", UnknownLBAs[i]);
|
||||
}
|
||||
|
||||
Console.WriteLine("Total sectors........... {0}", inputFormat.GetSectors());
|
||||
Console.WriteLine("Total errors............ {0}", FailingLBAs.Count);
|
||||
Console.WriteLine("Total unknowns.......... {0}", UnknownLBAs.Count);
|
||||
Console.WriteLine("Total errors+unknowns... {0}", FailingLBAs.Count + UnknownLBAs.Count);
|
||||
DicConsole.WriteLine("Total sectors........... {0}", inputFormat.GetSectors());
|
||||
DicConsole.WriteLine("Total errors............ {0}", FailingLBAs.Count);
|
||||
DicConsole.WriteLine("Total unknowns.......... {0}", UnknownLBAs.Count);
|
||||
DicConsole.WriteLine("Total errors+unknowns... {0}", FailingLBAs.Count + UnknownLBAs.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,5 +179,9 @@
|
||||
<Project>{9183F2E0-A879-4F23-9EE3-C6908F1332B2}</Project>
|
||||
<Name>DiscImageChef.Interop</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\DiscImageChef.Console\DiscImageChef.Console.csproj">
|
||||
<Project>{CCAA7AFE-C094-4D82-A66D-630DE8A3F545}</Project>
|
||||
<Name>DiscImageChef.Console</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -42,15 +42,12 @@ using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.PartPlugins;
|
||||
using DiscImageChef.Plugins;
|
||||
using System.Reflection;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
namespace DiscImageChef
|
||||
{
|
||||
class MainClass
|
||||
{
|
||||
|
||||
public static bool isDebug;
|
||||
public static bool isVerbose;
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
string invokedVerb = "";
|
||||
@@ -75,64 +72,85 @@ namespace DiscImageChef
|
||||
Version AssemblyVersion = typeof(MainClass).Assembly.GetName().Version;
|
||||
string AssemblyCopyright = ((AssemblyCopyrightAttribute) attributes[0]).Copyright;
|
||||
|
||||
Console.WriteLine("{0} {1}", AssemblyTitle, AssemblyVersion);
|
||||
Console.WriteLine("{0}", AssemblyCopyright);
|
||||
Console.WriteLine();
|
||||
DicConsole.WriteLineEvent += System.Console.WriteLine;
|
||||
DicConsole.ErrorWriteLineEvent += System.Console.Error.WriteLine;
|
||||
|
||||
DicConsole.WriteLine("{0} {1}", AssemblyTitle, AssemblyVersion);
|
||||
DicConsole.WriteLine("{0}", AssemblyCopyright);
|
||||
DicConsole.WriteLine();
|
||||
|
||||
switch (invokedVerb)
|
||||
{
|
||||
case "analyze":
|
||||
AnalyzeSubOptions AnalyzeOptions = (AnalyzeSubOptions)invokedVerbInstance;
|
||||
isDebug = AnalyzeOptions.Debug;
|
||||
isVerbose = AnalyzeOptions.Verbose;
|
||||
if (AnalyzeOptions.Debug)
|
||||
DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if (AnalyzeOptions.Verbose)
|
||||
DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
Commands.Analyze.doAnalyze(AnalyzeOptions);
|
||||
break;
|
||||
case "compare":
|
||||
CompareSubOptions CompareOptions = (CompareSubOptions)invokedVerbInstance;
|
||||
isDebug = CompareOptions.Debug;
|
||||
isVerbose = CompareOptions.Verbose;
|
||||
if (CompareOptions.Debug)
|
||||
DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if (CompareOptions.Verbose)
|
||||
DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
Commands.Compare.doCompare(CompareOptions);
|
||||
break;
|
||||
case "checksum":
|
||||
ChecksumSubOptions ChecksumOptions = (ChecksumSubOptions)invokedVerbInstance;
|
||||
isDebug = ChecksumOptions.Debug;
|
||||
isVerbose = ChecksumOptions.Verbose;
|
||||
if (ChecksumOptions.Debug)
|
||||
DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if (ChecksumOptions.Verbose)
|
||||
DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
Commands.Checksum.doChecksum(ChecksumOptions);
|
||||
break;
|
||||
case "entropy":
|
||||
EntropySubOptions entropyOptions = (EntropySubOptions)invokedVerbInstance;
|
||||
isDebug = entropyOptions.Debug;
|
||||
isVerbose = entropyOptions.Verbose;
|
||||
if (entropyOptions.Debug)
|
||||
DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if (entropyOptions.Verbose)
|
||||
DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
Commands.Entropy.doEntropy(entropyOptions);
|
||||
break;
|
||||
case "verify":
|
||||
VerifySubOptions VerifyOptions = (VerifySubOptions)invokedVerbInstance;
|
||||
isDebug = VerifyOptions.Debug;
|
||||
isVerbose = VerifyOptions.Verbose;
|
||||
if (VerifyOptions.Debug)
|
||||
DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if (VerifyOptions.Verbose)
|
||||
DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
Commands.Verify.doVerify(VerifyOptions);
|
||||
break;
|
||||
case "printhex":
|
||||
PrintHexSubOptions PrintHexOptions = (PrintHexSubOptions)invokedVerbInstance;
|
||||
isDebug = PrintHexOptions.Debug;
|
||||
isVerbose = PrintHexOptions.Verbose;
|
||||
if (PrintHexOptions.Debug)
|
||||
DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if (PrintHexOptions.Verbose)
|
||||
DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
Commands.PrintHex.doPrintHex(PrintHexOptions);
|
||||
break;
|
||||
case "decode":
|
||||
DecodeSubOptions DecodeOptions = (DecodeSubOptions)invokedVerbInstance;
|
||||
isDebug = DecodeOptions.Debug;
|
||||
isVerbose = DecodeOptions.Verbose;
|
||||
if (DecodeOptions.Debug)
|
||||
DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if (DecodeOptions.Verbose)
|
||||
DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
Commands.Decode.doDecode(DecodeOptions);
|
||||
break;
|
||||
case "formats":
|
||||
FormatsSubOptions FormatsOptions = (FormatsSubOptions)invokedVerbInstance;
|
||||
isVerbose = FormatsOptions.Verbose;
|
||||
isDebug = FormatsOptions.Debug;
|
||||
Commands.Formats.ListFormats();
|
||||
if (FormatsOptions.Debug)
|
||||
DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if (FormatsOptions.Verbose)
|
||||
DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
Commands.Formats.ListFormats(FormatsOptions);
|
||||
break;
|
||||
case "device-info":
|
||||
DeviceInfoSubOptions DeviceInfoOptions = (DeviceInfoSubOptions)invokedVerbInstance;
|
||||
isVerbose = DeviceInfoOptions.Verbose;
|
||||
isDebug = DeviceInfoOptions.Debug;
|
||||
if (DeviceInfoOptions.Debug)
|
||||
DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if (DeviceInfoOptions.Verbose)
|
||||
DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
Commands.DeviceInfo.doDeviceInfo(DeviceInfoOptions);
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace DiscImageChef
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Console.WriteLine(exception);
|
||||
System.Console.Error.WriteLine(exception);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace DiscImageChef
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Console.WriteLine(exception);
|
||||
System.Console.Error.WriteLine(exception);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace DiscImageChef
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Console.WriteLine(exception);
|
||||
System.Console.Error.WriteLine(exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user