2018-09-02 01:41:03 +01:00
|
|
|
// /***************************************************************************
|
|
|
|
|
// The Disc Image Chef
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Filename : pnlDeviceInfo.xeto.cs
|
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
//
|
|
|
|
|
// Component : Device information.
|
|
|
|
|
//
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Implements the device information panel.
|
|
|
|
|
//
|
|
|
|
|
// --[ 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 © 2011-2018 Natalia Portillo
|
|
|
|
|
// ****************************************************************************/
|
|
|
|
|
|
2018-09-02 18:28:08 +01:00
|
|
|
using System;
|
|
|
|
|
using System.IO;
|
2018-09-02 21:37:26 +01:00
|
|
|
using DiscImageChef.Console;
|
2018-09-06 21:48:17 +01:00
|
|
|
using DiscImageChef.Decoders.PCMCIA;
|
2018-09-06 19:36:09 +01:00
|
|
|
using DiscImageChef.Decoders.SCSI.SSC;
|
2018-09-02 23:41:19 +01:00
|
|
|
using DiscImageChef.Devices;
|
2018-10-07 15:49:12 +01:00
|
|
|
using DiscImageChef.Gui.Tabs;
|
2018-09-02 01:41:03 +01:00
|
|
|
using Eto.Forms;
|
|
|
|
|
using Eto.Serialization.Xaml;
|
2018-09-02 23:41:19 +01:00
|
|
|
using DeviceInfo = DiscImageChef.Core.Devices.Info.DeviceInfo;
|
2018-09-06 21:48:17 +01:00
|
|
|
using Tuple = DiscImageChef.Decoders.PCMCIA.Tuple;
|
2018-09-02 01:41:03 +01:00
|
|
|
|
2018-09-09 01:07:46 +01:00
|
|
|
namespace DiscImageChef.Gui.Panels
|
2018-09-02 01:41:03 +01:00
|
|
|
{
|
|
|
|
|
public class pnlDeviceInfo : Panel
|
|
|
|
|
{
|
2018-09-02 18:28:08 +01:00
|
|
|
DeviceInfo devInfo;
|
|
|
|
|
|
2018-09-02 01:41:03 +01:00
|
|
|
public pnlDeviceInfo(DeviceInfo devInfo)
|
|
|
|
|
{
|
|
|
|
|
XamlReader.Load(this);
|
|
|
|
|
|
2018-09-02 18:28:08 +01:00
|
|
|
this.devInfo = devInfo;
|
|
|
|
|
|
2018-09-02 01:41:03 +01:00
|
|
|
txtType.Text = devInfo.Type.ToString();
|
|
|
|
|
txtManufacturer.Text = devInfo.Manufacturer;
|
|
|
|
|
txtModel.Text = devInfo.Model;
|
|
|
|
|
txtRevision.Text = devInfo.Revision;
|
|
|
|
|
txtSerial.Text = devInfo.Serial;
|
|
|
|
|
txtScsiType.Text = devInfo.ScsiType.ToString();
|
|
|
|
|
chkRemovable.Checked = devInfo.IsRemovable;
|
|
|
|
|
chkUsb.Checked = devInfo.IsUsb;
|
2018-09-02 18:28:08 +01:00
|
|
|
|
2018-09-06 21:23:52 +01:00
|
|
|
if(devInfo.IsUsb)
|
|
|
|
|
{
|
|
|
|
|
tabUsb.Visible = true;
|
|
|
|
|
btnSaveUsbDescriptors.Enabled = devInfo.UsbDescriptors != null;
|
|
|
|
|
txtUsbVendorId.Text = $"{devInfo.UsbVendorId:X4}";
|
|
|
|
|
txtUsbProductId.Text = $"{devInfo.UsbProductId:X4}";
|
|
|
|
|
txtUsbManufacturer.Text = devInfo.UsbManufacturerString;
|
|
|
|
|
txtUsbProduct.Text = devInfo.UsbProductString;
|
|
|
|
|
txtUsbSerial.Text = devInfo.UsbSerialString;
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-06 21:35:18 +01:00
|
|
|
if(devInfo.IsFireWire)
|
|
|
|
|
{
|
|
|
|
|
tabFirewire.Visible = true;
|
|
|
|
|
txtFirewireVendorId.Text = $"{devInfo.FireWireVendor:X4}";
|
|
|
|
|
txtFirewireModelId.Text = $"{devInfo.FireWireModel:X4}";
|
|
|
|
|
txtFirewireManufacturer.Text = devInfo.FireWireVendorName;
|
|
|
|
|
txtFirewireModel.Text = devInfo.FireWireModelName;
|
|
|
|
|
txtFirewireGuid.Text = $"{devInfo.FireWireGuid:X16}";
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-06 21:48:17 +01:00
|
|
|
if(devInfo.IsPcmcia)
|
|
|
|
|
{
|
|
|
|
|
tabPcmcia.Visible = true;
|
|
|
|
|
|
|
|
|
|
TreeGridItemCollection cisList = new TreeGridItemCollection();
|
|
|
|
|
|
2018-10-07 13:47:58 +01:00
|
|
|
treePcmcia.Columns.Add(new GridColumn {HeaderText = "CIS", DataCell = new TextBoxCell(0)});
|
2018-09-06 21:48:17 +01:00
|
|
|
|
2018-10-07 13:47:58 +01:00
|
|
|
treePcmcia.AllowMultipleSelection = false;
|
|
|
|
|
treePcmcia.ShowHeader = false;
|
|
|
|
|
treePcmcia.DataStore = cisList;
|
2018-09-06 21:48:17 +01:00
|
|
|
|
|
|
|
|
Tuple[] tuples = CIS.GetTuples(devInfo.Cis);
|
|
|
|
|
if(tuples != null)
|
|
|
|
|
foreach(Tuple tuple in tuples)
|
|
|
|
|
{
|
|
|
|
|
string tupleCode;
|
|
|
|
|
string tupleDescription;
|
|
|
|
|
|
|
|
|
|
switch(tuple.Code)
|
|
|
|
|
{
|
|
|
|
|
case TupleCodes.CISTPL_NULL:
|
|
|
|
|
case TupleCodes.CISTPL_END: continue;
|
|
|
|
|
case TupleCodes.CISTPL_DEVICEGEO:
|
|
|
|
|
case TupleCodes.CISTPL_DEVICEGEO_A:
|
|
|
|
|
tupleCode = "Device Geometry Tuples";
|
|
|
|
|
tupleDescription = CIS.PrettifyDeviceGeometryTuple(tuple);
|
|
|
|
|
break;
|
|
|
|
|
case TupleCodes.CISTPL_MANFID:
|
|
|
|
|
tupleCode = "Manufacturer Identification Tuple";
|
|
|
|
|
tupleDescription = CIS.PrettifyManufacturerIdentificationTuple(tuple);
|
|
|
|
|
break;
|
|
|
|
|
case TupleCodes.CISTPL_VERS_1:
|
|
|
|
|
tupleCode = "Level 1 Version / Product Information Tuple";
|
|
|
|
|
tupleDescription = CIS.PrettifyLevel1VersionTuple(tuple);
|
|
|
|
|
break;
|
|
|
|
|
case TupleCodes.CISTPL_ALTSTR:
|
|
|
|
|
case TupleCodes.CISTPL_BAR:
|
|
|
|
|
case TupleCodes.CISTPL_BATTERY:
|
|
|
|
|
case TupleCodes.CISTPL_BYTEORDER:
|
|
|
|
|
case TupleCodes.CISTPL_CFTABLE_ENTRY:
|
|
|
|
|
case TupleCodes.CISTPL_CFTABLE_ENTRY_CB:
|
|
|
|
|
case TupleCodes.CISTPL_CHECKSUM:
|
|
|
|
|
case TupleCodes.CISTPL_CONFIG:
|
|
|
|
|
case TupleCodes.CISTPL_CONFIG_CB:
|
|
|
|
|
case TupleCodes.CISTPL_DATE:
|
|
|
|
|
case TupleCodes.CISTPL_DEVICE:
|
|
|
|
|
case TupleCodes.CISTPL_DEVICE_A:
|
|
|
|
|
case TupleCodes.CISTPL_DEVICE_OA:
|
|
|
|
|
case TupleCodes.CISTPL_DEVICE_OC:
|
|
|
|
|
case TupleCodes.CISTPL_EXTDEVIC:
|
|
|
|
|
case TupleCodes.CISTPL_FORMAT:
|
|
|
|
|
case TupleCodes.CISTPL_FORMAT_A:
|
|
|
|
|
case TupleCodes.CISTPL_FUNCE:
|
|
|
|
|
case TupleCodes.CISTPL_FUNCID:
|
|
|
|
|
case TupleCodes.CISTPL_GEOMETRY:
|
|
|
|
|
case TupleCodes.CISTPL_INDIRECT:
|
|
|
|
|
case TupleCodes.CISTPL_JEDEC_A:
|
|
|
|
|
case TupleCodes.CISTPL_JEDEC_C:
|
|
|
|
|
case TupleCodes.CISTPL_LINKTARGET:
|
|
|
|
|
case TupleCodes.CISTPL_LONGLINK_A:
|
|
|
|
|
case TupleCodes.CISTPL_LONGLINK_C:
|
|
|
|
|
case TupleCodes.CISTPL_LONGLINK_CB:
|
|
|
|
|
case TupleCodes.CISTPL_LONGLINK_MFC:
|
|
|
|
|
case TupleCodes.CISTPL_NO_LINK:
|
|
|
|
|
case TupleCodes.CISTPL_ORG:
|
|
|
|
|
case TupleCodes.CISTPL_PWR_MGMNT:
|
|
|
|
|
case TupleCodes.CISTPL_SPCL:
|
|
|
|
|
case TupleCodes.CISTPL_SWIL:
|
|
|
|
|
case TupleCodes.CISTPL_VERS_2:
|
|
|
|
|
tupleCode = $"Undecoded tuple ID {tuple.Code}";
|
|
|
|
|
tupleDescription = $"Undecoded tuple ID {tuple.Code}";
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
tupleCode = $"0x{(byte)tuple.Code:X2}";
|
|
|
|
|
tupleDescription = $"Found unknown tuple ID 0x{(byte)tuple.Code:X2}";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cisList.Add(new TreeGridItem {Values = new object[] {tupleCode, tupleDescription}});
|
|
|
|
|
}
|
|
|
|
|
else DicConsole.DebugWriteLine("Device-Info command", "PCMCIA CIS returned no tuples");
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-02 18:28:08 +01:00
|
|
|
if(devInfo.AtaIdentify != null || devInfo.AtapiIdentify != null)
|
|
|
|
|
{
|
2018-10-07 16:32:32 +01:00
|
|
|
tabAtaInfo tabAtaInfo = new tabAtaInfo();
|
|
|
|
|
tabAtaInfo.LoadData(devInfo.AtaIdentify, devInfo.AtapiIdentify, devInfo.AtaMcptError);
|
2018-09-02 18:28:08 +01:00
|
|
|
|
2018-10-07 16:32:32 +01:00
|
|
|
tabInfos.Pages.Add(tabAtaInfo);
|
2018-09-02 18:28:08 +01:00
|
|
|
}
|
2018-09-02 20:42:48 +01:00
|
|
|
|
|
|
|
|
if(devInfo.ScsiInquiryData != null)
|
|
|
|
|
{
|
2018-10-07 15:49:12 +01:00
|
|
|
tabScsiInfo tabScsiInfo = new tabScsiInfo();
|
|
|
|
|
tabScsiInfo.LoadData(devInfo.ScsiInquiryData, devInfo.ScsiInquiry, devInfo.ScsiEvpdPages,
|
|
|
|
|
devInfo.ScsiMode, devInfo.ScsiType, devInfo.ScsiModeSense6,
|
|
|
|
|
devInfo.ScsiModeSense10, devInfo.MmcConfiguration);
|
2018-09-02 20:42:48 +01:00
|
|
|
|
2018-10-07 15:49:12 +01:00
|
|
|
tabInfos.Pages.Add(tabScsiInfo);
|
2018-09-02 23:41:19 +01:00
|
|
|
|
2018-09-03 00:54:59 +01:00
|
|
|
if(devInfo.PlextorFeatures != null)
|
|
|
|
|
{
|
|
|
|
|
tabPlextor.Visible = true;
|
|
|
|
|
if(devInfo.PlextorFeatures.Eeprom != null)
|
|
|
|
|
{
|
|
|
|
|
stkPlextorEeprom.Visible = true;
|
|
|
|
|
txtPlextorDiscs.Text = $"{devInfo.PlextorFeatures.Discs}";
|
|
|
|
|
txtPlextorCdReadTime.Text = TimeSpan.FromSeconds(devInfo.PlextorFeatures.CdReadTime).ToString();
|
|
|
|
|
txtPlextorCdWriteTime.Text =
|
|
|
|
|
TimeSpan.FromSeconds(devInfo.PlextorFeatures.CdWriteTime).ToString();
|
|
|
|
|
if(devInfo.PlextorFeatures.IsDvd)
|
|
|
|
|
{
|
|
|
|
|
stkPlextorDvdTimes.Visible = true;
|
|
|
|
|
txtPlextorDvdReadTime.Text =
|
|
|
|
|
TimeSpan.FromSeconds(devInfo.PlextorFeatures.DvdReadTime).ToString();
|
|
|
|
|
txtPlextorDvdWriteTime.Text =
|
|
|
|
|
TimeSpan.FromSeconds(devInfo.PlextorFeatures.DvdWriteTime).ToString();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
chkPlextorPoweRec.Checked = devInfo.PlextorFeatures.PoweRec;
|
|
|
|
|
|
|
|
|
|
if(devInfo.PlextorFeatures.PoweRec)
|
|
|
|
|
{
|
|
|
|
|
chkPlextorPoweRecEnabled.Visible = true;
|
|
|
|
|
chkPlextorPoweRecEnabled.Checked = devInfo.PlextorFeatures.PoweRecEnabled;
|
|
|
|
|
|
|
|
|
|
if(devInfo.PlextorFeatures.PoweRecEnabled)
|
|
|
|
|
{
|
|
|
|
|
stkPlextorPoweRecEnabled.Visible = true;
|
|
|
|
|
|
|
|
|
|
if(devInfo.PlextorFeatures.PoweRecRecommendedSpeed > 0)
|
|
|
|
|
{
|
|
|
|
|
stkPlextorPoweRecRecommended.Visible = true;
|
|
|
|
|
txtPlextorPoweRecRecommended.Text =
|
|
|
|
|
$"{devInfo.PlextorFeatures.PoweRecRecommendedSpeed} Kb/sec.";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(devInfo.PlextorFeatures.PoweRecSelected > 0)
|
|
|
|
|
{
|
|
|
|
|
stkPlextorPoweRecSelected.Visible = true;
|
|
|
|
|
txtPlextorPoweRecSelected.Text =
|
|
|
|
|
$"{devInfo.PlextorFeatures.PoweRecSelected} Kb/sec.";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(devInfo.PlextorFeatures.PoweRecMax > 0)
|
|
|
|
|
{
|
|
|
|
|
stkPlextorPoweRecMax.Visible = true;
|
|
|
|
|
txtPlextorPoweRecMax.Text = $"{devInfo.PlextorFeatures.PoweRecMax} Kb/sec.";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(devInfo.PlextorFeatures.PoweRecLast > 0)
|
|
|
|
|
{
|
|
|
|
|
stkPlextorPoweRecLast.Visible = true;
|
|
|
|
|
txtPlextorPoweRecLast.Text = $"{devInfo.PlextorFeatures.PoweRecLast} Kb/sec.";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
chkPlextorSilentMode.Checked = devInfo.PlextorFeatures.SilentMode;
|
|
|
|
|
|
|
|
|
|
if(devInfo.PlextorFeatures.SilentMode)
|
|
|
|
|
{
|
|
|
|
|
chkPlextorSilentModeEnabled.Visible = true;
|
|
|
|
|
chkPlextorSilentModeEnabled.Checked = devInfo.PlextorFeatures.SilentModeEnabled;
|
|
|
|
|
|
|
|
|
|
if(devInfo.PlextorFeatures.SilentModeEnabled)
|
|
|
|
|
{
|
|
|
|
|
lblPlextorSilentModeAccessTime.Text = devInfo.PlextorFeatures.AccessTimeLimit == 2
|
|
|
|
|
? "\tAccess time is slow"
|
|
|
|
|
: "\tAccess time is fast";
|
|
|
|
|
|
|
|
|
|
txtPlextorSilentModeCdReadSpeedLimit.Text =
|
|
|
|
|
devInfo.PlextorFeatures.CdReadSpeedLimit > 0
|
|
|
|
|
? $"{devInfo.PlextorFeatures.CdReadSpeedLimit}x"
|
|
|
|
|
: "unlimited";
|
|
|
|
|
|
|
|
|
|
txtPlextorSilentModeCdWriteSpeedLimit.Text =
|
|
|
|
|
devInfo.PlextorFeatures.CdWriteSpeedLimit > 0
|
|
|
|
|
? $"{devInfo.PlextorFeatures.CdReadSpeedLimit}x"
|
|
|
|
|
: "unlimited";
|
|
|
|
|
|
|
|
|
|
if(devInfo.PlextorFeatures.IsDvd)
|
|
|
|
|
{
|
|
|
|
|
stkPlextorSilentModeDvdReadSpeedLimit.Visible = true;
|
|
|
|
|
txtPlextorSilentModeDvdReadSpeedLimit.Text =
|
|
|
|
|
devInfo.PlextorFeatures.DvdReadSpeedLimit > 0
|
|
|
|
|
? $"{devInfo.PlextorFeatures.DvdReadSpeedLimit}x"
|
|
|
|
|
: "unlimited";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
chkPlextorGigaRec.Checked = devInfo.PlextorFeatures.GigaRec;
|
|
|
|
|
chkPlextorSecuRec.Checked = devInfo.PlextorFeatures.SecuRec;
|
|
|
|
|
chkPlextorSpeedRead.Checked = devInfo.PlextorFeatures.SpeedRead;
|
|
|
|
|
|
|
|
|
|
if(devInfo.PlextorFeatures.SpeedRead)
|
|
|
|
|
{
|
|
|
|
|
chkPlextorSpeedEnabled.Visible = true;
|
|
|
|
|
chkPlextorSpeedEnabled.Checked = devInfo.PlextorFeatures.SpeedReadEnabled;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
chkPlextorHiding.Checked = devInfo.PlextorFeatures.Hiding;
|
|
|
|
|
if(devInfo.PlextorFeatures.Hiding)
|
|
|
|
|
{
|
|
|
|
|
stkPlextorHiding.Visible = true;
|
|
|
|
|
chkPlextorHidesRecordables.Checked = devInfo.PlextorFeatures.HidesRecordables;
|
|
|
|
|
chkPlextorHidesSessions.Checked = devInfo.PlextorFeatures.HidesSessions;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
chkPlextorVariRec.Checked = devInfo.PlextorFeatures.VariRec;
|
|
|
|
|
|
|
|
|
|
if(devInfo.PlextorFeatures.IsDvd)
|
|
|
|
|
{
|
|
|
|
|
stkPlextorDvd.Visible = true;
|
|
|
|
|
chkPlextorVariRecDvd.Checked = devInfo.PlextorFeatures.VariRecDvd;
|
|
|
|
|
chkPlextorBitSetting.Checked = devInfo.PlextorFeatures.BitSetting;
|
|
|
|
|
chkPlextorBitSettingDl.Checked = devInfo.PlextorFeatures.BitSettingDl;
|
|
|
|
|
chkPlextorDvdPlusWriteTest.Checked = devInfo.PlextorFeatures.DvdPlusWriteTest;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-02 23:41:19 +01:00
|
|
|
if(devInfo.ScsiInquiry.Value.KreonPresent)
|
|
|
|
|
{
|
|
|
|
|
tabKreon.Visible = true;
|
|
|
|
|
chkKreonChallengeResponse.Checked = devInfo.KreonFeatures.HasFlag(KreonFeatures.ChallengeResponse);
|
|
|
|
|
chkKreonDecryptSs.Checked = devInfo.KreonFeatures.HasFlag(KreonFeatures.DecryptSs);
|
|
|
|
|
chkKreonXtremeUnlock.Checked = devInfo.KreonFeatures.HasFlag(KreonFeatures.XtremeUnlock);
|
|
|
|
|
chkKreonWxripperUnlock.Checked = devInfo.KreonFeatures.HasFlag(KreonFeatures.WxripperUnlock);
|
|
|
|
|
chkKreonChallengeResponse360.Checked =
|
|
|
|
|
devInfo.KreonFeatures.HasFlag(KreonFeatures.ChallengeResponse360);
|
|
|
|
|
chkKreonDecryptSs360.Checked = devInfo.KreonFeatures.HasFlag(KreonFeatures.DecryptSs360);
|
|
|
|
|
chkKreonXtremeUnlock360.Checked = devInfo.KreonFeatures.HasFlag(KreonFeatures.XtremeUnlock360);
|
|
|
|
|
chkKreonWxripperUnlock360.Checked = devInfo.KreonFeatures.HasFlag(KreonFeatures.WxripperUnlock360);
|
|
|
|
|
chkKreonLock.Checked = devInfo.KreonFeatures.HasFlag(KreonFeatures.Lock);
|
|
|
|
|
chkKreonErrorSkipping.Checked = devInfo.KreonFeatures.HasFlag(KreonFeatures.ErrorSkipping);
|
|
|
|
|
}
|
2018-09-06 19:36:09 +01:00
|
|
|
|
|
|
|
|
if(devInfo.BlockLimits != null)
|
|
|
|
|
{
|
|
|
|
|
BlockLimits.BlockLimitsData? blockLimits = BlockLimits.Decode(devInfo.BlockLimits);
|
|
|
|
|
|
|
|
|
|
if(blockLimits.HasValue)
|
|
|
|
|
{
|
|
|
|
|
tabSsc.Visible = true;
|
|
|
|
|
if(blockLimits.Value.minBlockLen == blockLimits.Value.maxBlockLen)
|
|
|
|
|
{
|
|
|
|
|
lblMinBlockSize.Visible = true;
|
|
|
|
|
lblMinBlockSize.Text =
|
|
|
|
|
$"Device's block size is fixed at {blockLimits.Value.minBlockLen} bytes";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
lblMinBlockSize.Visible = true;
|
|
|
|
|
lblMaxBlockSize.Visible = true;
|
|
|
|
|
|
|
|
|
|
lblMaxBlockSize.Text = blockLimits.Value.maxBlockLen > 0
|
|
|
|
|
? $"Device's maximum block size is {blockLimits.Value.maxBlockLen} bytes"
|
|
|
|
|
: "Device does not specify a maximum block size";
|
|
|
|
|
lblMinBlockSize.Text =
|
|
|
|
|
$"Device's minimum block size is {blockLimits.Value.minBlockLen} bytes";
|
|
|
|
|
|
|
|
|
|
if(blockLimits.Value.granularity > 0)
|
|
|
|
|
{
|
|
|
|
|
lblBlockSizeGranularity.Visible = true;
|
|
|
|
|
lblBlockSizeGranularity.Text =
|
|
|
|
|
$"Device's needs a block size granularity of 2^{blockLimits.Value.granularity} ({Math.Pow(2, blockLimits.Value.granularity)}) bytes";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(devInfo.DensitySupport != null)
|
|
|
|
|
if(devInfo.DensitySupportHeader.HasValue)
|
|
|
|
|
{
|
|
|
|
|
stkDensities.Visible = true;
|
|
|
|
|
txtDensities.Text = DensitySupport.PrettifyDensity(devInfo.DensitySupportHeader);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(devInfo.MediumDensitySupport != null)
|
|
|
|
|
{
|
|
|
|
|
if(devInfo.MediaTypeSupportHeader.HasValue)
|
|
|
|
|
{
|
|
|
|
|
stkMediaTypes.Visible = true;
|
|
|
|
|
txtMediumTypes.Text = DensitySupport.PrettifyMediumType(devInfo.MediaTypeSupportHeader);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
txtMediumDensity.Visible = true;
|
|
|
|
|
txtMediumDensity.Text = DensitySupport.PrettifyMediumType(devInfo.MediumDensitySupport);
|
|
|
|
|
}
|
2018-09-02 20:42:48 +01:00
|
|
|
}
|
2018-09-06 20:03:00 +01:00
|
|
|
|
|
|
|
|
switch(devInfo.Type)
|
|
|
|
|
{
|
|
|
|
|
case DeviceType.MMC:
|
|
|
|
|
{
|
|
|
|
|
tabSecureDigital.Text = "MultiMediaCard";
|
|
|
|
|
if(devInfo.CID != null)
|
|
|
|
|
{
|
2018-09-06 21:59:33 +01:00
|
|
|
tabCid.Visible = true;
|
2018-09-06 21:23:52 +01:00
|
|
|
txtCid.Text = Decoders.MMC.Decoders.PrettifyCID(devInfo.CID);
|
2018-09-06 20:03:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(devInfo.CSD != null)
|
|
|
|
|
{
|
2018-09-06 21:59:33 +01:00
|
|
|
tabCsd.Visible = true;
|
2018-09-06 21:23:52 +01:00
|
|
|
txtCid.Text = Decoders.MMC.Decoders.PrettifyCSD(devInfo.CSD);
|
2018-09-06 20:03:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(devInfo.OCR != null)
|
|
|
|
|
{
|
2018-09-06 21:59:33 +01:00
|
|
|
tabOcr.Visible = true;
|
2018-09-06 21:23:52 +01:00
|
|
|
txtCid.Text = Decoders.MMC.Decoders.PrettifyOCR(devInfo.OCR);
|
2018-09-06 20:03:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(devInfo.ExtendedCSD != null)
|
|
|
|
|
{
|
2018-09-06 21:59:33 +01:00
|
|
|
tabExtendedCsd.Visible = true;
|
2018-09-06 21:23:52 +01:00
|
|
|
txtCid.Text = Decoders.MMC.Decoders.PrettifyExtendedCSD(devInfo.ExtendedCSD);
|
2018-09-06 20:03:00 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case DeviceType.SecureDigital:
|
|
|
|
|
{
|
|
|
|
|
tabSecureDigital.Text = "SecureDigital";
|
|
|
|
|
if(devInfo.CID != null)
|
|
|
|
|
{
|
2018-09-06 21:59:33 +01:00
|
|
|
tabCid.Visible = true;
|
2018-09-06 20:03:00 +01:00
|
|
|
|
|
|
|
|
txtCid.Text = Decoders.SecureDigital.Decoders.PrettifyCID(devInfo.CID);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(devInfo.CSD != null)
|
|
|
|
|
{
|
2018-09-06 21:59:33 +01:00
|
|
|
tabCsd.Visible = true;
|
2018-09-06 20:03:00 +01:00
|
|
|
|
|
|
|
|
txtCid.Text = Decoders.SecureDigital.Decoders.PrettifyCSD(devInfo.CSD);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(devInfo.OCR != null)
|
|
|
|
|
{
|
2018-09-06 21:59:33 +01:00
|
|
|
tabOcr.Visible = true;
|
2018-09-06 21:23:52 +01:00
|
|
|
txtCid.Text = Decoders.SecureDigital.Decoders.PrettifyOCR(devInfo.OCR);
|
2018-09-06 20:03:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(devInfo.SCR != null)
|
|
|
|
|
{
|
2018-09-06 21:59:33 +01:00
|
|
|
tabScr.Visible = true;
|
2018-09-06 21:23:52 +01:00
|
|
|
txtCid.Text = Decoders.SecureDigital.Decoders.PrettifySCR(devInfo.SCR);
|
2018-09-06 20:03:00 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-06 21:59:33 +01:00
|
|
|
tabSecureDigital.Visible = tabCid.Visible || tabCsd.Visible || tabOcr.Visible || tabExtendedCsd.Visible ||
|
|
|
|
|
tabScr.Visible;
|
2018-09-02 18:28:08 +01:00
|
|
|
}
|
|
|
|
|
|
2018-09-06 21:23:52 +01:00
|
|
|
protected void OnBtnSaveUsbDescriptors(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
SaveFileDialog dlgSaveBinary = new SaveFileDialog();
|
|
|
|
|
dlgSaveBinary.Filters.Add(new FileFilter {Extensions = new[] {"*.bin"}, Name = "Binary"});
|
|
|
|
|
DialogResult result = dlgSaveBinary.ShowDialog(this);
|
|
|
|
|
|
|
|
|
|
if(result != DialogResult.Ok) return;
|
|
|
|
|
|
|
|
|
|
FileStream saveFs = new FileStream(dlgSaveBinary.FileName, FileMode.Create);
|
|
|
|
|
saveFs.Write(devInfo.UsbDescriptors, 0, devInfo.UsbDescriptors.Length);
|
|
|
|
|
|
|
|
|
|
saveFs.Close();
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-06 21:48:17 +01:00
|
|
|
protected void OnTreePcmciaSelectedItemChanged(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if(!(treePcmcia.SelectedItem is TreeGridItem item)) return;
|
|
|
|
|
|
|
|
|
|
txtPcmciaCis.Text = item.Values[1] as string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected void OnBtnSavePcmciaCis(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
SaveFileDialog dlgSaveBinary = new SaveFileDialog();
|
|
|
|
|
dlgSaveBinary.Filters.Add(new FileFilter {Extensions = new[] {"*.bin"}, Name = "Binary"});
|
|
|
|
|
DialogResult result = dlgSaveBinary.ShowDialog(this);
|
|
|
|
|
|
|
|
|
|
if(result != DialogResult.Ok) return;
|
|
|
|
|
|
|
|
|
|
FileStream saveFs = new FileStream(dlgSaveBinary.FileName, FileMode.Create);
|
|
|
|
|
saveFs.Write(devInfo.Cis, 0, devInfo.Cis.Length);
|
|
|
|
|
|
|
|
|
|
saveFs.Close();
|
|
|
|
|
}
|
|
|
|
|
|
2018-09-02 01:41:03 +01:00
|
|
|
#region XAML controls
|
2018-09-02 22:35:06 +01:00
|
|
|
#pragma warning disable 169
|
|
|
|
|
#pragma warning disable 649
|
2018-09-02 20:42:48 +01:00
|
|
|
Label lblDeviceInfo;
|
|
|
|
|
TabControl tabInfos;
|
|
|
|
|
TabPage tabGeneral;
|
|
|
|
|
Label lblType;
|
|
|
|
|
TextBox txtType;
|
|
|
|
|
Label lblManufacturer;
|
|
|
|
|
TextBox txtManufacturer;
|
|
|
|
|
Label lblModel;
|
|
|
|
|
TextBox txtModel;
|
|
|
|
|
Label lblRevision;
|
|
|
|
|
TextBox txtRevision;
|
|
|
|
|
Label lblSerial;
|
|
|
|
|
TextBox txtSerial;
|
|
|
|
|
Label lblScsiType;
|
|
|
|
|
TextBox txtScsiType;
|
|
|
|
|
CheckBox chkRemovable;
|
|
|
|
|
CheckBox chkUsb;
|
2018-09-02 23:41:19 +01:00
|
|
|
TabPage tabKreon;
|
|
|
|
|
CheckBox chkKreonChallengeResponse;
|
|
|
|
|
CheckBox chkKreonDecryptSs;
|
|
|
|
|
CheckBox chkKreonXtremeUnlock;
|
|
|
|
|
CheckBox chkKreonWxripperUnlock;
|
|
|
|
|
CheckBox chkKreonChallengeResponse360;
|
|
|
|
|
CheckBox chkKreonDecryptSs360;
|
|
|
|
|
CheckBox chkKreonXtremeUnlock360;
|
|
|
|
|
CheckBox chkKreonWxripperUnlock360;
|
|
|
|
|
CheckBox chkKreonLock;
|
|
|
|
|
CheckBox chkKreonErrorSkipping;
|
2018-09-03 00:54:59 +01:00
|
|
|
TabPage tabPlextor;
|
|
|
|
|
StackLayout stkPlextorEeprom;
|
|
|
|
|
Label lblPlextorDiscs;
|
|
|
|
|
TextBox txtPlextorDiscs;
|
|
|
|
|
Label lblPlextorCdReadTime;
|
|
|
|
|
TextBox txtPlextorCdReadTime;
|
|
|
|
|
Label lblPlextorCdWriteTime;
|
|
|
|
|
TextBox txtPlextorCdWriteTime;
|
|
|
|
|
StackLayout stkPlextorDvdTimes;
|
|
|
|
|
Label lblPlextorDvdReadTime;
|
|
|
|
|
TextBox txtPlextorDvdReadTime;
|
|
|
|
|
Label lblPlextorDvdWriteTime;
|
|
|
|
|
TextBox txtPlextorDvdWriteTime;
|
|
|
|
|
CheckBox chkPlextorPoweRec;
|
|
|
|
|
CheckBox chkPlextorPoweRecEnabled;
|
|
|
|
|
StackLayout stkPlextorPoweRecEnabled;
|
|
|
|
|
StackLayout stkPlextorPoweRecRecommended;
|
|
|
|
|
Label lblPlextorPoweRecRecommended;
|
|
|
|
|
TextBox txtPlextorPoweRecRecommended;
|
|
|
|
|
StackLayout stkPlextorPoweRecSelected;
|
|
|
|
|
Label lblPlextorPoweRecSelected;
|
|
|
|
|
TextBox txtPlextorPoweRecSelected;
|
|
|
|
|
StackLayout stkPlextorPoweRecMax;
|
|
|
|
|
Label lblPlextorPoweRecMax;
|
|
|
|
|
TextBox txtPlextorPoweRecMax;
|
|
|
|
|
StackLayout stkPlextorPoweRecLast;
|
|
|
|
|
Label lblPlextorPoweRecLast;
|
|
|
|
|
TextBox txtPlextorPoweRecLast;
|
|
|
|
|
CheckBox chkPlextorSilentMode;
|
|
|
|
|
CheckBox chkPlextorSilentModeEnabled;
|
|
|
|
|
StackLayout stkPlextorSilentModeEnabled;
|
|
|
|
|
Label lblPlextorSilentModeAccessTime;
|
|
|
|
|
Label lblPlextorSilentModeCdReadSpeedLimit;
|
|
|
|
|
TextBox txtPlextorSilentModeCdReadSpeedLimit;
|
|
|
|
|
StackLayout stkPlextorSilentModeDvdReadSpeedLimit;
|
|
|
|
|
Label lblPlextorSilentModeDvdReadSpeedLimit;
|
|
|
|
|
TextBox txtPlextorSilentModeDvdReadSpeedLimit;
|
|
|
|
|
Label lblPlextorSilentModeCdWriteSpeedLimit;
|
|
|
|
|
TextBox txtPlextorSilentModeCdWriteSpeedLimit;
|
|
|
|
|
CheckBox chkPlextorGigaRec;
|
|
|
|
|
CheckBox chkPlextorSecuRec;
|
|
|
|
|
CheckBox chkPlextorSpeedRead;
|
|
|
|
|
CheckBox chkPlextorSpeedEnabled;
|
|
|
|
|
CheckBox chkPlextorHiding;
|
|
|
|
|
StackLayout stkPlextorHiding;
|
|
|
|
|
CheckBox chkPlextorHidesRecordables;
|
|
|
|
|
CheckBox chkPlextorHidesSessions;
|
|
|
|
|
CheckBox chkPlextorVariRec;
|
|
|
|
|
StackLayout stkPlextorDvd;
|
|
|
|
|
CheckBox chkPlextorVariRecDvd;
|
|
|
|
|
CheckBox chkPlextorBitSetting;
|
|
|
|
|
CheckBox chkPlextorBitSettingDl;
|
|
|
|
|
CheckBox chkPlextorDvdPlusWriteTest;
|
2018-09-06 19:36:09 +01:00
|
|
|
TabPage tabSsc;
|
|
|
|
|
Label lblMinBlockSize;
|
|
|
|
|
Label lblMaxBlockSize;
|
|
|
|
|
Label lblBlockSizeGranularity;
|
|
|
|
|
StackLayout stkDensities;
|
|
|
|
|
Label lblDensities;
|
|
|
|
|
TextArea txtDensities;
|
|
|
|
|
StackLayout stkMediaTypes;
|
|
|
|
|
Label lblMediumTypes;
|
|
|
|
|
TextArea txtMediumTypes;
|
|
|
|
|
TextArea txtMediumDensity;
|
2018-09-06 21:23:52 +01:00
|
|
|
TabPage tabSecureDigital;
|
|
|
|
|
TabPage tabCid;
|
|
|
|
|
TextArea txtCid;
|
|
|
|
|
TabPage tabCsd;
|
|
|
|
|
TextArea txtCsd;
|
|
|
|
|
TabPage tabOcr;
|
|
|
|
|
TextArea txtOcr;
|
|
|
|
|
TabPage tabExtendedCsd;
|
|
|
|
|
TextArea txtExtendedCsd;
|
|
|
|
|
TabPage tabScr;
|
|
|
|
|
TextArea txtScr;
|
|
|
|
|
TabPage tabUsb;
|
|
|
|
|
Label lblUsbVendorId;
|
|
|
|
|
TextBox txtUsbVendorId;
|
|
|
|
|
Label lblUsbProductId;
|
|
|
|
|
TextBox txtUsbProductId;
|
|
|
|
|
Label lblUsbManufacturer;
|
|
|
|
|
TextBox txtUsbManufacturer;
|
|
|
|
|
Label lblUsbProduct;
|
|
|
|
|
TextBox txtUsbProduct;
|
|
|
|
|
Label lblUsbSerial;
|
|
|
|
|
TextBox txtUsbSerial;
|
|
|
|
|
Button btnSaveUsbDescriptors;
|
2018-09-06 21:35:18 +01:00
|
|
|
TabPage tabFirewire;
|
|
|
|
|
Label lblFirewireVendorId;
|
|
|
|
|
TextBox txtFirewireVendorId;
|
|
|
|
|
Label lblFirewireModelId;
|
|
|
|
|
TextBox txtFirewireModelId;
|
|
|
|
|
Label lblFirewireManufacturer;
|
|
|
|
|
TextBox txtFirewireManufacturer;
|
|
|
|
|
Label lblFirewireModel;
|
|
|
|
|
TextBox txtFirewireModel;
|
|
|
|
|
Label lblFirewireGuid;
|
|
|
|
|
TextBox txtFirewireGuid;
|
2018-09-06 21:48:17 +01:00
|
|
|
TabPage tabPcmcia;
|
|
|
|
|
TreeGridView treePcmcia;
|
|
|
|
|
TextArea txtPcmciaCis;
|
|
|
|
|
Button btnSavePcmciaCis;
|
2018-09-02 22:35:06 +01:00
|
|
|
#pragma warning restore 169
|
|
|
|
|
#pragma warning restore 649
|
2018-09-02 01:41:03 +01:00
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|