Compare commits

..

5 Commits
1.05.1 ... 1.06

Author SHA1 Message Date
Matt Nadareski
61ce45667b Update for 1.06 2018-06-15 20:27:34 -07:00
Matt Nadareski
ababfdd2ed XBOX/360 Fixes (#50)
* Better creation of parameters (fixes Xbox/360)

* Split X360 into XDG2/3

* Don't enable drive speed if we're not supposed to

* Add first attempt at Xbox info extraction

* Trim or it never matches
2018-06-15 20:24:43 -07:00
Matt Nadareski
9683074197 Only eject when told 2018-06-14 20:18:01 -07:00
Matt Nadareski
ab2bc8f50c Worst typo ever 2018-06-14 20:11:49 -07:00
reignstumble
aa86ddaf47 Fix incorrectly enabled button 2018-06-14 20:40:41 -04:00
7 changed files with 198 additions and 77 deletions

View File

@@ -104,10 +104,10 @@
public const string PlayStationLibCryptField = "LibCrypt"; // TODO: Not automatic yet
public const string SaturnHeaderField = "Header";
public const string SaturnBuildDateField = "Build Date";
public const string XBOXDMICRC = "DMI.bin CRC32"; // TODO: Not automatic yet
public const string XBOXPFICRC = "PFI.bin CRC32"; // TODO: Not automatic yet
public const string XBOXSSCRC = "SS.bin CRC32"; // TODO: Not automatic yet
public const string XBOXSSRanges = "Security Sector Ranges"; // TODO: Not automatic yet
public const string XBOXDMIHash = "DMI.bin Hashes";
public const string XBOXPFIHash = "PFI.bin Hashes";
public const string XBOXSSHash = "SS.bin Hashes";
public const string XBOXSSRanges = "Security Sector Ranges";
// Default values

View File

@@ -40,7 +40,8 @@
CommodoreAmigaCDTV,
MattelHyperscan,
MicrosoftXBOX,
MicrosoftXBOX360,
MicrosoftXBOX360XDG2,
MicrosoftXBOX360XDG3,
MicrosoftXBOXOne,
NECPCEngineTurboGrafxCD,
NECPCFX,

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
@@ -58,7 +58,11 @@ namespace DICUI
else if ((string)btn_StartStop.Content == UIElements.StopDumping)
{
CancelDumping();
EjectDisc();
if (chk_EjectWhenDone.IsChecked == true)
{
EjectDisc();
}
}
}
@@ -159,7 +163,7 @@ namespace DICUI
if (cmb_DriveLetter.Items.Count > 0)
{
lbl_Status.Content = "Valid optical disc found! Choose your Disc Type";
btn_StartStop.IsEnabled = true;
btn_StartStop.IsEnabled = (_drives.Count > 0 ? true : false);
}
else
{
@@ -460,7 +464,7 @@ namespace DICUI
case DiscType.GameCubeGameDisc:
case DiscType.GDROM:
lbl_Status.Content = string.Format("{0} discs are partially supported by DIC", Converters.DiscTypeToString(tuple.Item3));
btn_StartStop.IsEnabled = true;
btn_StartStop.IsEnabled = (_drives.Count > 0 ? true : false);
break;
case DiscType.HDDVD:
case DiscType.UMD:
@@ -469,9 +473,22 @@ namespace DICUI
lbl_Status.Content = string.Format("{0} discs are not currently supported by DIC", Converters.DiscTypeToString(tuple.Item3));
btn_StartStop.IsEnabled = false;
break;
case DiscType.DVD5:
case DiscType.DVD9:
if (tuple.Item2 == KnownSystem.MicrosoftXBOX360XDG3)
{
lbl_Status.Content = string.Format("{0} discs are not currently supported by DIC", Converters.DiscTypeToString(tuple.Item3));
btn_StartStop.IsEnabled = false;
}
else
{
lbl_Status.Content = string.Format("{0} ready to dump", Converters.DiscTypeToString(tuple.Item3));
btn_StartStop.IsEnabled = (_drives.Count > 0 ? true : false);
}
break;
default:
lbl_Status.Content = string.Format("{0} ready to dump", Converters.DiscTypeToString(tuple.Item3));
btn_StartStop.IsEnabled = true;
btn_StartStop.IsEnabled = (_drives.Count > 0 ? true : false);
break;
}
@@ -484,7 +501,16 @@ namespace DICUI
cmb_DriveSpeed.IsEnabled = false;
break;
default:
cmb_DriveSpeed.IsEnabled = true;
if (tuple.Item2 == KnownSystem.MicrosoftXBOX
|| tuple.Item2 == KnownSystem.MicrosoftXBOX360XDG2
|| tuple.Item2 == KnownSystem.MicrosoftXBOX360XDG3)
{
cmb_DriveSpeed.IsEnabled = false;
}
else
{
cmb_DriveSpeed.IsEnabled = true;
}
break;
}
@@ -497,7 +523,7 @@ namespace DICUI
btn_OutputDirectoryBrowse.IsEnabled = false;
cmb_DriveLetter.IsEnabled = false;
cmb_DriveSpeed.IsEnabled = false;
btn_StartStop.IsEnabled = true;
btn_StartStop.IsEnabled = (_drives.Count > 0 ? true : false);
lbl_Status.Content = "User input mode";
}
else
@@ -507,7 +533,6 @@ namespace DICUI
txt_OutputDirectory.IsEnabled = true;
btn_OutputDirectoryBrowse.IsEnabled = true;
cmb_DriveLetter.IsEnabled = true;
cmb_DriveSpeed.IsEnabled = true;
// Populate with the correct params for inputs (if we're not on the default option)
if (cmb_DiscType.SelectedIndex > 0)
@@ -521,7 +546,7 @@ namespace DICUI
return;
}
string discType = Converters.DiscTypeToBaseCommand(selected.Item3);
string discType = Converters.KnownSystemAndDiscTypeToBaseCommand(selected.Item2, selected.Item3);
List<string> defaultParams = Converters.KnownSystemAndDiscTypeToParameters(selected.Item2, selected.Item3);
txt_Parameters.Text = discType
+ " " + driveletter.Item1
@@ -530,7 +555,8 @@ namespace DICUI
&& selected.Item3 != DiscType.BD25
&& selected.Item3 != DiscType.BD50
&& selected.Item2 != KnownSystem.MicrosoftXBOX
&& selected.Item2 != KnownSystem.MicrosoftXBOX360
&& selected.Item2 != KnownSystem.MicrosoftXBOX360XDG2
&& selected.Item2 != KnownSystem.MicrosoftXBOX360XDG3
? (int)cmb_DriveSpeed.SelectedItem + " " : "")
+ string.Join(" ", defaultParams);
}

View File

@@ -26,6 +26,16 @@ Dizzzy - Concept/Ideas/Beta tester
Download the latest release here:
[https://github.com/reignstumble/DICUI/releases](https://github.com/reignstumble/DICUI/releases)
--------------------------------------------------------------------------
2018-06-15
--------------------------------------------------------------------------
Version 1.06 released:
- Fixed not being able to use the `/c2` flag properly
- Fixed times when the ability to start dumping was improperly allowed
- Added full support for XBOX and XBOX360 (XDG1, XDG2) dumping through DIC (using a Kreon, or presumably a 0800)
--------------------------------------------------------------------------
2018-06-14
--------------------------------------------------------------------------

View File

@@ -59,47 +59,6 @@ namespace DICUI.Utilities
}
}
/// <summary>
/// Get the DIC command to be used for a given DiscType
/// </summary>
/// <param name="type">DiscType value to check</param>
/// <returns>String containing the command, null on error</returns>
public static string DiscTypeToBaseCommand(DiscType? type)
{
switch (type)
{
case DiscType.CD:
return DICCommands.CompactDisc;
case DiscType.DVD5:
case DiscType.DVD9:
return DICCommands.DigitalVideoDisc;
case DiscType.GDROM:
return DICCommands.GDROM;
case DiscType.HDDVD:
return null;
case DiscType.BD25:
case DiscType.BD50:
return DICCommands.BluRay;
// Special Formats
case DiscType.GameCubeGameDisc:
return DICCommands.DigitalVideoDisc;
case DiscType.WiiOpticalDisc:
return null;
case DiscType.WiiUOpticalDisc:
return null;
case DiscType.UMD:
return null;
// Non-optical
case DiscType.Floppy:
return DICCommands.Floppy;
default:
return null;
}
}
/// <summary>
/// Get the default extension for a given disc type
/// </summary>
@@ -174,6 +133,64 @@ namespace DICUI.Utilities
}
}
/// <summary>
/// Get the DIC command to be used for a given DiscType
/// </summary>
/// <param name="type">DiscType value to check</param>
/// <returns>String containing the command, null on error</returns>
public static string KnownSystemAndDiscTypeToBaseCommand(KnownSystem? sys, DiscType? type)
{
switch (type)
{
case DiscType.CD:
if (sys == KnownSystem.MicrosoftXBOX)
{
return DICCommands.XBOX;
}
return DICCommands.CompactDisc;
case DiscType.DVD5:
if (sys == KnownSystem.MicrosoftXBOX
|| sys == KnownSystem.MicrosoftXBOX360XDG2
|| sys == KnownSystem.MicrosoftXBOX360XDG3)
{
return DICCommands.XBOX;
}
return DICCommands.DigitalVideoDisc;
case DiscType.DVD9:
if (sys == KnownSystem.MicrosoftXBOX
|| sys == KnownSystem.MicrosoftXBOX360XDG2
|| sys == KnownSystem.MicrosoftXBOX360XDG3)
{
return DICCommands.XBOX;
}
return DICCommands.DigitalVideoDisc;
case DiscType.GDROM:
return DICCommands.GDROM;
case DiscType.HDDVD:
return null;
case DiscType.BD25:
case DiscType.BD50:
return DICCommands.BluRay;
// Special Formats
case DiscType.GameCubeGameDisc:
return DICCommands.DigitalVideoDisc;
case DiscType.WiiOpticalDisc:
return null;
case DiscType.WiiUOpticalDisc:
return null;
case DiscType.UMD:
return null;
// Non-optical
case DiscType.Floppy:
return DICCommands.Floppy;
default:
return null;
}
}
/// <summary>
/// Get list of default parameters for a given system and disc type
/// </summary>
@@ -275,8 +292,10 @@ namespace DICUI.Utilities
return "Mattel HyperScan";
case KnownSystem.MicrosoftXBOX:
return "Microsoft XBOX";
case KnownSystem.MicrosoftXBOX360:
return "Microsoft XBOX 360";
case KnownSystem.MicrosoftXBOX360XDG2:
return "Microsoft XBOX 360 (XDG2)";
case KnownSystem.MicrosoftXBOX360XDG3:
return "Microsoft XBOX 360 (XDG3)";
case KnownSystem.MicrosoftXBOXOne:
return "Microsoft XBOX One";
case KnownSystem.NECPCEngineTurboGrafxCD:

View File

@@ -206,7 +206,7 @@ namespace DICUI.Utilities
}
break;
case DiscType.DVD5: // TODO: Add XBOX360-specific outputs to this
case DiscType.DVD5:
case DiscType.HDDVD:
case DiscType.BD25:
mappings[Template.MasteringRingField] = Template.RequiredIfExistsValue;
@@ -232,12 +232,6 @@ namespace DICUI.Utilities
}
}
break;
case KnownSystem.MicrosoftXBOX:
mappings[Template.XBOXDMICRC] = Template.RequiredValue;
mappings[Template.XBOXPFICRC] = Template.RequiredValue;
mappings[Template.XBOXSSCRC] = Template.RequiredValue;
mappings[Template.XBOXSSRanges] = Template.RequiredValue;
break;
case KnownSystem.SonyPlayStation2:
mappings[Template.PlaystationEXEDateField] = GetPlayStationEXEDate(driveLetter);
mappings[Template.VersionField] = GetPlayStation2Version(driveLetter);
@@ -245,7 +239,7 @@ namespace DICUI.Utilities
}
break;
case DiscType.DVD9: // TODO: Add XBOX360-specific outputs to this
case DiscType.DVD9:
case DiscType.BD50:
mappings["Outer " + Template.MasteringRingField] = Template.RequiredIfExistsValue;
mappings["Inner " + Template.MasteringRingField] = Template.RequiredIfExistsValue;
@@ -275,10 +269,15 @@ namespace DICUI.Utilities
}
break;
case KnownSystem.MicrosoftXBOX:
mappings[Template.XBOXDMICRC] = Template.RequiredValue;
mappings[Template.XBOXPFICRC] = Template.RequiredValue;
mappings[Template.XBOXSSCRC] = Template.RequiredValue;
mappings[Template.XBOXSSRanges] = Template.RequiredValue;
case KnownSystem.MicrosoftXBOX360XDG2:
case KnownSystem.MicrosoftXBOX360XDG3:
if (GetXBOXAuxInfo(combinedBase + "_disc.txt", out string dmihash, out string pfihash, out string sshash, out string ss))
{
mappings[Template.XBOXDMIHash] = dmihash;
mappings[Template.XBOXPFIHash] = pfihash;
mappings[Template.XBOXSSHash] = sshash;
mappings[Template.XBOXSSRanges] = ss;
}
break;
case KnownSystem.SonyPlayStation2:
mappings[Template.PlaystationEXEDateField] = GetPlayStationEXEDate(driveLetter);
@@ -669,6 +668,64 @@ namespace DICUI.Utilities
}
}
/// <summary>
/// Get the XBOX/360 auxiliary info from the outputted files, if possible
/// </summary>
/// <param name="disc">_disc.txt file location</param>
/// <returns>True on successful extraction of info, false otherwise</returns>
private static bool GetXBOXAuxInfo(string disc, out string dmihash, out string pfihash, out string sshash, out string ss)
{
dmihash = null; pfihash = null; sshash = null; ss = null;
// If the file doesn't exist, we can't get info from it
if (!File.Exists(disc))
{
return false;
}
using (StreamReader sr = File.OpenText(disc))
{
try
{
// Make sure this file is a _disc.txt for XBOX
if (sr.ReadLine() != "========== Lock state ==========")
{
return false;
}
// Fast forward to the Security Sector Ranges
while (!sr.ReadLine().Trim().StartsWith("Number of security sector ranges:")) ;
// Now that we're at the ranges, read each line in and concatenate
// TODO: Make this output like the old method (startlba-endlba)
string line = sr.ReadLine();
while (!line.Trim().StartsWith("========== Unlock 2 state(wxripper) =========="))
{
ss += line + "\n";
line = sr.ReadLine();
}
// Fast forward to the aux hashes
while (!line.Trim().StartsWith("<rom"))
{
line = sr.ReadLine();
}
// Read in the hashes to the proper parts
sshash = line.Trim();
pfihash = sr.ReadLine().Trim();
dmihash = sr.ReadLine().Trim();
return true;
}
catch
{
// We don't care what the exception is right now
return false;
}
}
}
/// <summary>
/// Get the write offset from the input file, if possible
/// </summary>
@@ -825,9 +882,11 @@ namespace DICUI.Utilities
}
break;
case KnownSystem.MicrosoftXBOX:
output.Add(Template.XBOXDMICRC + ": " + info[Template.XBOXDMICRC]);
output.Add(Template.XBOXPFICRC + ": " + info[Template.XBOXPFICRC]);
output.Add(Template.XBOXSSCRC + ": " + info[Template.XBOXSSCRC]); output.Add("");
case KnownSystem.MicrosoftXBOX360XDG2:
case KnownSystem.MicrosoftXBOX360XDG3:
output.Add(Template.XBOXDMIHash + ": " + info[Template.XBOXDMIHash]);
output.Add(Template.XBOXPFIHash + ": " + info[Template.XBOXPFIHash]);
output.Add(Template.XBOXSSHash + ": " + info[Template.XBOXSSHash]); output.Add("");
output.Add(Template.XBOXSSRanges + ":"); output.Add("");
output.AddRange(info[Template.XBOXSSRanges].Split('\n'));
break;

View File

@@ -39,9 +39,14 @@ namespace DICUI.Utilities
break;
case KnownSystem.MicrosoftXBOX:
types.Add(DiscType.CD);
types.Add(DiscType.DVD5);
types.Add(DiscType.DVD9);
break;
case KnownSystem.MicrosoftXBOX360:
case KnownSystem.MicrosoftXBOX360XDG2:
types.Add(DiscType.CD);
types.Add(DiscType.DVD9);
types.Add(DiscType.HDDVD);
break;
case KnownSystem.MicrosoftXBOX360XDG3:
types.Add(DiscType.CD);
types.Add(DiscType.DVD9);
types.Add(DiscType.HDDVD);
@@ -479,7 +484,8 @@ namespace DICUI.Utilities
new ManagementObjectSearcher("root\\CIMV2",
"SELECT * FROM Win32_LogicalDisk");
foreach (ManagementObject queryObj in searcher.Get())
var collection = searcher.Get();
foreach (ManagementObject queryObj in collection)
{
uint? mediaType = (uint?)queryObj["MediaType"];
if (mediaType != null && ((mediaType > 0 && mediaType < 11) || (mediaType > 12 && mediaType < 22)))
@@ -925,7 +931,7 @@ namespace DICUI.Utilities
break;
}
// If the next item isn't a valid number
else if (!IsValidNumber(parts[i + i], lowerBound: 0))
else if (!IsValidNumber(parts[i + 1], lowerBound: 0))
{
return false;
}