diff --git a/.idea/.idea.DiscImageChef/.idea/contentModel.xml b/.idea/.idea.DiscImageChef/.idea/contentModel.xml
index 7b8e2cc52..cfec869cc 100644
--- a/.idea/.idea.DiscImageChef/.idea/contentModel.xml
+++ b/.idea/.idea.DiscImageChef/.idea/contentModel.xml
@@ -1624,6 +1624,8 @@
+
+
diff --git a/DiscImageChef.Gui/Panels/pnlImageInfo.xeto.cs b/DiscImageChef.Gui/Panels/pnlImageInfo.xeto.cs
index e26f2b909..d921c52e2 100644
--- a/DiscImageChef.Gui/Panels/pnlImageInfo.xeto.cs
+++ b/DiscImageChef.Gui/Panels/pnlImageInfo.xeto.cs
@@ -38,6 +38,7 @@ using DiscImageChef.CommonTypes.Interfaces;
using DiscImageChef.Decoders.CD;
using DiscImageChef.Decoders.DVD;
using DiscImageChef.Decoders.SCSI;
+using DiscImageChef.Decoders.Xbox;
using DiscImageChef.Gui.Tabs;
using Eto.Forms;
using Eto.Serialization.Xaml;
@@ -543,6 +544,25 @@ namespace DiscImageChef.Gui.Panels
tabBlurayInfo.LoadData(blurayDiscInformation, blurayBurstCuttingArea, blurayDds, blurayCartridgeStatus,
bluraySpareAreaInformation, blurayPowResources, blurayTrackResources, null, null);
tabInfos.Pages.Add(tabBlurayInfo);
+
+ byte[] xboxDmi = null;
+ byte[] xboxSecuritySector = null;
+ SS.SecuritySector? decodedXboxSecuritySector = null;
+
+ if(imageFormat.Info.ReadableMediaTags != null &&
+ imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.Xbox_DMI))
+ xboxDmi = imageFormat.ReadDiskTag(MediaTagType.Xbox_DMI);
+
+ if(imageFormat.Info.ReadableMediaTags != null &&
+ imageFormat.Info.ReadableMediaTags.Contains(MediaTagType.Xbox_SecuritySector))
+ {
+ xboxSecuritySector = imageFormat.ReadDiskTag(MediaTagType.Xbox_SecuritySector);
+ decodedXboxSecuritySector = SS.Decode(xboxSecuritySector);
+ }
+
+ tabXboxInfo tabXboxInfo = new tabXboxInfo();
+ tabXboxInfo.LoadData(null, xboxDmi, xboxSecuritySector, decodedXboxSecuritySector);
+ tabInfos.Pages.Add(tabXboxInfo);
}
#region XAML controls
diff --git a/DiscImageChef.Gui/Panels/pnlScsiInfo.xeto b/DiscImageChef.Gui/Panels/pnlScsiInfo.xeto
index c6cc472a3..bab264ee5 100644
--- a/DiscImageChef.Gui/Panels/pnlScsiInfo.xeto
+++ b/DiscImageChef.Gui/Panels/pnlScsiInfo.xeto
@@ -101,60 +101,6 @@
Text="Save REPORT DENSITY SUPPORT (MEDIUM & MEDIA) response" Visible="False"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/DiscImageChef.Gui/Panels/pnlScsiInfo.xeto.cs b/DiscImageChef.Gui/Panels/pnlScsiInfo.xeto.cs
index 1bd711a79..452012f53 100644
--- a/DiscImageChef.Gui/Panels/pnlScsiInfo.xeto.cs
+++ b/DiscImageChef.Gui/Panels/pnlScsiInfo.xeto.cs
@@ -36,7 +36,6 @@ using System.Text;
using DiscImageChef.CommonTypes;
using DiscImageChef.Core.Media.Info;
using DiscImageChef.Decoders.SCSI.SSC;
-using DiscImageChef.Decoders.Xbox;
using DiscImageChef.Gui.Controls;
using DiscImageChef.Gui.Forms;
using DiscImageChef.Gui.Tabs;
@@ -131,40 +130,10 @@ namespace DiscImageChef.Gui.Panels
this.scsiInfo.DecodedPfi);
tabInfos.Pages.Add(tabDvdInfo);
- if(this.scsiInfo.XgdInfo != null)
- {
- stkXboxInformation.Visible = true;
- txtXboxL0Video.Text = $"{this.scsiInfo.XgdInfo.L0Video} sectors";
- txtXboxL1Video.Text = $"{this.scsiInfo.XgdInfo.L1Video} sectors";
- txtXboxMiddleZone.Text = $"{this.scsiInfo.XgdInfo.MiddleZone} sectors";
- txtXboxGameSize.Text = $"{this.scsiInfo.XgdInfo.GameSize} sectors";
- txtXboxTotalSize.Text = $"{this.scsiInfo.XgdInfo.TotalSize} sectors";
- txtXboxRealBreak.Text = this.scsiInfo.XgdInfo.LayerBreak.ToString();
- }
-
- if(this.scsiInfo.DvdDmi != null)
- {
- if(DMI.IsXbox(scsiInfo.DvdDmi))
- {
- grpXboxDmi.Visible = true;
- txtXboxDmi.Text = DMI.PrettifyXbox(scsiInfo.DvdDmi);
- }
- else if(DMI.IsXbox360(scsiInfo.DvdDmi))
- {
- grpXboxDmi.Visible = true;
- txtXboxDmi.Text = DMI.PrettifyXbox360(scsiInfo.DvdDmi);
- }
- }
-
- if(this.scsiInfo.DecodedXboxSecuritySector.HasValue)
- {
- grpXboxSs.Visible = true;
- txtXboxSs.Text = SS.Prettify(this.scsiInfo.DecodedXboxSecuritySector);
- }
-
- btnSaveXboxSs.Visible = this.scsiInfo.XboxSecuritySector != null;
- tabXbox.Visible = stkXboxInformation.Visible || grpXboxDmi.Visible || grpXboxSs.Visible ||
- btnSaveXboxSs.Visible;
+ tabXboxInfo tabXboxInfo = new tabXboxInfo();
+ tabXboxInfo.LoadData(scsiInfo.XgdInfo, scsiInfo.DvdDmi, scsiInfo.XboxSecuritySector,
+ scsiInfo.DecodedXboxSecuritySector);
+ tabInfos.Pages.Add(tabXboxInfo);
tabDvdWritableInfo tabDvdWritableInfo = new tabDvdWritableInfo();
tabDvdWritableInfo.LoadData(scsiInfo.MediaType, scsiInfo.DvdRamDds, scsiInfo.DvdRamCartridgeStatus,
diff --git a/DiscImageChef.Gui/Tabs/tabXboxInfo.xeto b/DiscImageChef.Gui/Tabs/tabXboxInfo.xeto
new file mode 100644
index 000000000..35d853c8f
--- /dev/null
+++ b/DiscImageChef.Gui/Tabs/tabXboxInfo.xeto
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/DiscImageChef.Gui/Tabs/tabXboxInfo.xeto.cs b/DiscImageChef.Gui/Tabs/tabXboxInfo.xeto.cs
new file mode 100644
index 000000000..d6a39185a
--- /dev/null
+++ b/DiscImageChef.Gui/Tabs/tabXboxInfo.xeto.cs
@@ -0,0 +1,136 @@
+// /***************************************************************************
+// The Disc Image Chef
+// ----------------------------------------------------------------------------
+//
+// Filename : pnlScsiInfo.xeto.cs
+// Author(s) : Natalia Portillo
+//
+// Component : SCSI media information panel.
+//
+// --[ Description ] ----------------------------------------------------------
+//
+// Implements the SCSI media 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 .
+//
+// ----------------------------------------------------------------------------
+// Copyright © 2011-2018 Natalia Portillo
+// ****************************************************************************/
+
+using System;
+using System.IO;
+using DiscImageChef.Core.Media.Info;
+using DiscImageChef.Decoders.Xbox;
+using Eto.Forms;
+using Eto.Serialization.Xaml;
+
+namespace DiscImageChef.Gui.Panels
+{
+ public class tabXboxInfo : TabPage
+ {
+ byte[] XboxSecuritySector;
+
+ public tabXboxInfo()
+ {
+ XamlReader.Load(this);
+ }
+
+ internal void LoadData(XgdInfo xgdInfo, byte[] dmi, byte[] securitySector,
+ SS.SecuritySector? decodedSecuritySector)
+ {
+ XboxSecuritySector = securitySector;
+
+ if(xgdInfo != null)
+ {
+ stkXboxInformation.Visible = true;
+ txtXboxL0Video.Text = $"{xgdInfo.L0Video} sectors";
+ txtXboxL1Video.Text = $"{xgdInfo.L1Video} sectors";
+ txtXboxMiddleZone.Text = $"{xgdInfo.MiddleZone} sectors";
+ txtXboxGameSize.Text = $"{xgdInfo.GameSize} sectors";
+ txtXboxTotalSize.Text = $"{xgdInfo.TotalSize} sectors";
+ txtXboxRealBreak.Text = xgdInfo.LayerBreak.ToString();
+ }
+
+ if(dmi != null)
+ {
+ if(DMI.IsXbox(dmi))
+ {
+ grpXboxDmi.Visible = true;
+ txtXboxDmi.Text = DMI.PrettifyXbox(dmi);
+ }
+ else if(DMI.IsXbox360(dmi))
+ {
+ grpXboxDmi.Visible = true;
+ txtXboxDmi.Text = DMI.PrettifyXbox360(dmi);
+ }
+ }
+
+ if(decodedSecuritySector.HasValue)
+ {
+ grpXboxSs.Visible = true;
+ txtXboxSs.Text = SS.Prettify(decodedSecuritySector);
+ }
+
+ btnSaveXboxSs.Visible = securitySector != null;
+ Visible = stkXboxInformation.Visible || grpXboxDmi.Visible || grpXboxSs.Visible ||
+ btnSaveXboxSs.Visible;
+ }
+
+ void SaveElement(byte[] data)
+ {
+ 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(data, 0, data.Length);
+
+ saveFs.Close();
+ }
+
+ protected void OnBtnSaveXboxSsClick(object sender, EventArgs e)
+ {
+ SaveElement(XboxSecuritySector);
+ }
+
+ #region XAML controls
+ #pragma warning disable 169
+ #pragma warning disable 649
+ StackLayout stkXboxInformation;
+ Label lblXboxL0Video;
+ TextBox txtXboxL0Video;
+ Label lblXboxL1Video;
+ TextBox txtXboxL1Video;
+ Label lblXboxMiddleZone;
+ TextBox txtXboxMiddleZone;
+ Label lblXboxGameSize;
+ TextBox txtXboxGameSize;
+ Label lblXboxTotalSize;
+ TextBox txtXboxTotalSize;
+ Label lblXboxRealBreak;
+ TextBox txtXboxRealBreak;
+ GroupBox grpXboxDmi;
+ TextArea txtXboxDmi;
+ GroupBox grpXboxSs;
+ TextArea txtXboxSs;
+ Button btnSaveXboxSs;
+ #pragma warning restore 169
+ #pragma warning restore 649
+ #endregion
+ }
+}
\ No newline at end of file