mirror of
https://github.com/StudentBlake/XCI-Explorer
synced 2024-11-22 04:03:04 +00:00
New Version With Detailed Game Contents
This pull request extends XCI-Explorer with more detailed game contents: - Detailed contents of Super XCI/NSPs supported; - "GENERAL" of "Contents" in XCI-Explorer will always show the newest game version recognized from their Super XCI/NSPs. And some fix: - Fix issue #16: NSP and NSZ file extraction supported; - Fix the problem that extraction of a file smaller than 8kb failed to work properly; - Fix the display of some NSZ or DLC informations; - Extend drag and drop support to a larger area. This version has been tested for a while, only some modified Super XCI/NSPs (e.g. localization etc) fail to get recognized, due to their corrupted nca header.
This commit is contained in:
parent
24fab83cd4
commit
728b940d0e
2 changed files with 515 additions and 138 deletions
227
XCI_Explorer/MainForm.Designer.cs
generated
227
XCI_Explorer/MainForm.Designer.cs
generated
|
@ -36,17 +36,19 @@ namespace XCI_Explorer
|
|||
this.TB_File = new System.Windows.Forms.TextBox();
|
||||
this.TABC_Main = new System.Windows.Forms.TabControl();
|
||||
this.TABP_XCI = new System.Windows.Forms.TabPage();
|
||||
this.TB_GameRev = new System.Windows.Forms.RichTextBox();
|
||||
this.label12 = new System.Windows.Forms.Label();
|
||||
this.B_TrimXCI = new System.Windows.Forms.Button();
|
||||
this.TB_ProdCode = new System.Windows.Forms.TextBox();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.groupBox2 = new System.Windows.Forms.GroupBox();
|
||||
this.label11 = new System.Windows.Forms.Label();
|
||||
this.TB_Dev = new System.Windows.Forms.TextBox();
|
||||
this.label10 = new System.Windows.Forms.Label();
|
||||
this.TB_Name = new System.Windows.Forms.TextBox();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.PB_GameIcon = new System.Windows.Forms.PictureBox();
|
||||
this.CB_RegionName = new System.Windows.Forms.ComboBox();
|
||||
this.TB_GameRev = new System.Windows.Forms.TextBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
this.B_ViewCert = new System.Windows.Forms.Button();
|
||||
|
@ -87,9 +89,9 @@ namespace XCI_Explorer
|
|||
//
|
||||
// B_LoadROM
|
||||
//
|
||||
this.B_LoadROM.Location = new System.Drawing.Point(4, 12);
|
||||
this.B_LoadROM.Location = new System.Drawing.Point(4, 11);
|
||||
this.B_LoadROM.Name = "B_LoadROM";
|
||||
this.B_LoadROM.Size = new System.Drawing.Size(75, 23);
|
||||
this.B_LoadROM.Size = new System.Drawing.Size(75, 21);
|
||||
this.B_LoadROM.TabIndex = 0;
|
||||
this.B_LoadROM.Text = "Load Game";
|
||||
this.B_LoadROM.UseVisualStyleBackColor = true;
|
||||
|
@ -98,31 +100,31 @@ namespace XCI_Explorer
|
|||
// TB_File
|
||||
//
|
||||
this.TB_File.AllowDrop = true;
|
||||
this.TB_File.Location = new System.Drawing.Point(85, 13);
|
||||
this.TB_File.Location = new System.Drawing.Point(85, 12);
|
||||
this.TB_File.Name = "TB_File";
|
||||
this.TB_File.ReadOnly = true;
|
||||
this.TB_File.Size = new System.Drawing.Size(258, 20);
|
||||
this.TB_File.Size = new System.Drawing.Size(268, 21);
|
||||
this.TB_File.TabIndex = 1;
|
||||
this.TB_File.DragDrop += new System.Windows.Forms.DragEventHandler(this.TB_File_DragDrop);
|
||||
this.TB_File.DragEnter += new System.Windows.Forms.DragEventHandler(this.TB_File_DragEnter);
|
||||
//
|
||||
// TABC_Main
|
||||
//
|
||||
this.TABC_Main.Controls.Add(this.TABP_XCI);
|
||||
this.TABC_Main.Controls.Add(this.tabPage2);
|
||||
this.TABC_Main.Location = new System.Drawing.Point(4, 41);
|
||||
this.TABC_Main.Location = new System.Drawing.Point(4, 38);
|
||||
this.TABC_Main.Name = "TABC_Main";
|
||||
this.TABC_Main.SelectedIndex = 0;
|
||||
this.TABC_Main.Size = new System.Drawing.Size(355, 485);
|
||||
this.TABC_Main.Size = new System.Drawing.Size(364, 511);
|
||||
this.TABC_Main.TabIndex = 2;
|
||||
//
|
||||
// TABP_XCI
|
||||
//
|
||||
this.TABP_XCI.AllowDrop = true;
|
||||
this.TABP_XCI.Controls.Add(this.TB_GameRev);
|
||||
this.TABP_XCI.Controls.Add(this.label12);
|
||||
this.TABP_XCI.Controls.Add(this.B_TrimXCI);
|
||||
this.TABP_XCI.Controls.Add(this.TB_ProdCode);
|
||||
this.TABP_XCI.Controls.Add(this.label8);
|
||||
this.TABP_XCI.Controls.Add(this.groupBox2);
|
||||
this.TABP_XCI.Controls.Add(this.TB_GameRev);
|
||||
this.TABP_XCI.Controls.Add(this.label7);
|
||||
this.TABP_XCI.Controls.Add(this.groupBox1);
|
||||
this.TABP_XCI.Controls.Add(this.TB_ExactUsedSpace);
|
||||
|
@ -142,16 +144,37 @@ namespace XCI_Explorer
|
|||
this.TABP_XCI.Location = new System.Drawing.Point(4, 22);
|
||||
this.TABP_XCI.Name = "TABP_XCI";
|
||||
this.TABP_XCI.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.TABP_XCI.Size = new System.Drawing.Size(347, 459);
|
||||
this.TABP_XCI.Size = new System.Drawing.Size(356, 485);
|
||||
this.TABP_XCI.TabIndex = 0;
|
||||
this.TABP_XCI.Text = "Main";
|
||||
this.TABP_XCI.UseVisualStyleBackColor = true;
|
||||
this.TABP_XCI.Click += new System.EventHandler(this.TABP_XCI_Click);
|
||||
this.TABP_XCI.DragDrop += new System.Windows.Forms.DragEventHandler(this.TB_File_DragDrop);
|
||||
this.TABP_XCI.DragEnter += new System.Windows.Forms.DragEventHandler(this.TB_File_DragEnter);
|
||||
//
|
||||
// TB_GameRev
|
||||
//
|
||||
this.TB_GameRev.Location = new System.Drawing.Point(15, 63);
|
||||
this.TB_GameRev.Name = "TB_GameRev";
|
||||
this.TB_GameRev.ReadOnly = true;
|
||||
this.TB_GameRev.Size = new System.Drawing.Size(237, 99);
|
||||
this.TB_GameRev.TabIndex = 23;
|
||||
this.TB_GameRev.Text = "";
|
||||
//
|
||||
// label12
|
||||
//
|
||||
this.label12.AutoSize = true;
|
||||
this.label12.Location = new System.Drawing.Point(75, 48);
|
||||
this.label12.Name = "label12";
|
||||
this.label12.Size = new System.Drawing.Size(125, 12);
|
||||
this.label12.TabIndex = 22;
|
||||
this.label12.Text = "0 BASE, 0 UPD, 0 DLC";
|
||||
//
|
||||
// B_TrimXCI
|
||||
//
|
||||
this.B_TrimXCI.Location = new System.Drawing.Point(90, 207);
|
||||
this.B_TrimXCI.Location = new System.Drawing.Point(307, 178);
|
||||
this.B_TrimXCI.Name = "B_TrimXCI";
|
||||
this.B_TrimXCI.Size = new System.Drawing.Size(70, 23);
|
||||
this.B_TrimXCI.Size = new System.Drawing.Size(38, 46);
|
||||
this.B_TrimXCI.TabIndex = 21;
|
||||
this.B_TrimXCI.Text = "Trim XCI";
|
||||
this.B_TrimXCI.UseVisualStyleBackColor = true;
|
||||
|
@ -159,76 +182,87 @@ namespace XCI_Explorer
|
|||
//
|
||||
// TB_ProdCode
|
||||
//
|
||||
this.TB_ProdCode.Location = new System.Drawing.Point(238, 115);
|
||||
this.TB_ProdCode.Location = new System.Drawing.Point(258, 141);
|
||||
this.TB_ProdCode.Name = "TB_ProdCode";
|
||||
this.TB_ProdCode.ReadOnly = true;
|
||||
this.TB_ProdCode.Size = new System.Drawing.Size(69, 20);
|
||||
this.TB_ProdCode.Size = new System.Drawing.Size(87, 21);
|
||||
this.TB_ProdCode.TabIndex = 20;
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(235, 99);
|
||||
this.label8.Location = new System.Drawing.Point(258, 126);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(75, 13);
|
||||
this.label8.Size = new System.Drawing.Size(83, 12);
|
||||
this.label8.TabIndex = 19;
|
||||
this.label8.Text = "Product Code:";
|
||||
//
|
||||
// groupBox2
|
||||
//
|
||||
this.groupBox2.Controls.Add(this.label11);
|
||||
this.groupBox2.Controls.Add(this.TB_Dev);
|
||||
this.groupBox2.Controls.Add(this.label10);
|
||||
this.groupBox2.Controls.Add(this.TB_Name);
|
||||
this.groupBox2.Controls.Add(this.label9);
|
||||
this.groupBox2.Controls.Add(this.PB_GameIcon);
|
||||
this.groupBox2.Controls.Add(this.CB_RegionName);
|
||||
this.groupBox2.Location = new System.Drawing.Point(22, 296);
|
||||
this.groupBox2.Location = new System.Drawing.Point(15, 285);
|
||||
this.groupBox2.Name = "groupBox2";
|
||||
this.groupBox2.Size = new System.Drawing.Size(301, 154);
|
||||
this.groupBox2.Size = new System.Drawing.Size(330, 178);
|
||||
this.groupBox2.TabIndex = 18;
|
||||
this.groupBox2.TabStop = false;
|
||||
this.groupBox2.Text = "Game Infos";
|
||||
//
|
||||
// label11
|
||||
//
|
||||
this.label11.AutoSize = true;
|
||||
this.label11.Location = new System.Drawing.Point(6, 69);
|
||||
this.label11.Name = "label11";
|
||||
this.label11.Size = new System.Drawing.Size(59, 12);
|
||||
this.label11.TabIndex = 25;
|
||||
this.label11.Text = "Language:";
|
||||
this.label11.Click += new System.EventHandler(this.label11_Click);
|
||||
//
|
||||
// TB_Dev
|
||||
//
|
||||
this.TB_Dev.Location = new System.Drawing.Point(6, 117);
|
||||
this.TB_Dev.Location = new System.Drawing.Point(6, 138);
|
||||
this.TB_Dev.Name = "TB_Dev";
|
||||
this.TB_Dev.ReadOnly = true;
|
||||
this.TB_Dev.Size = new System.Drawing.Size(145, 20);
|
||||
this.TB_Dev.Size = new System.Drawing.Size(154, 21);
|
||||
this.TB_Dev.TabIndex = 24;
|
||||
//
|
||||
// label10
|
||||
//
|
||||
this.label10.AutoSize = true;
|
||||
this.label10.Location = new System.Drawing.Point(3, 101);
|
||||
this.label10.Location = new System.Drawing.Point(6, 123);
|
||||
this.label10.Name = "label10";
|
||||
this.label10.Size = new System.Drawing.Size(59, 13);
|
||||
this.label10.Size = new System.Drawing.Size(65, 12);
|
||||
this.label10.TabIndex = 23;
|
||||
this.label10.Text = "Developer:";
|
||||
//
|
||||
// TB_Name
|
||||
//
|
||||
this.TB_Name.Location = new System.Drawing.Point(6, 66);
|
||||
this.TB_Name.Location = new System.Drawing.Point(6, 35);
|
||||
this.TB_Name.Name = "TB_Name";
|
||||
this.TB_Name.ReadOnly = true;
|
||||
this.TB_Name.Size = new System.Drawing.Size(145, 20);
|
||||
this.TB_Name.Size = new System.Drawing.Size(154, 21);
|
||||
this.TB_Name.TabIndex = 22;
|
||||
//
|
||||
// label9
|
||||
//
|
||||
this.label9.AutoSize = true;
|
||||
this.label9.Location = new System.Drawing.Point(3, 50);
|
||||
this.label9.Location = new System.Drawing.Point(6, 20);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(38, 13);
|
||||
this.label9.Size = new System.Drawing.Size(35, 12);
|
||||
this.label9.TabIndex = 21;
|
||||
this.label9.Text = "Name:";
|
||||
//
|
||||
// PB_GameIcon
|
||||
//
|
||||
this.PB_GameIcon.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
|
||||
this.PB_GameIcon.Location = new System.Drawing.Point(190, 43);
|
||||
this.PB_GameIcon.Location = new System.Drawing.Point(172, 20);
|
||||
this.PB_GameIcon.Name = "PB_GameIcon";
|
||||
this.PB_GameIcon.Size = new System.Drawing.Size(105, 105);
|
||||
this.PB_GameIcon.Size = new System.Drawing.Size(152, 147);
|
||||
this.PB_GameIcon.TabIndex = 18;
|
||||
this.PB_GameIcon.TabStop = false;
|
||||
//
|
||||
|
@ -236,28 +270,20 @@ namespace XCI_Explorer
|
|||
//
|
||||
this.CB_RegionName.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.CB_RegionName.FormattingEnabled = true;
|
||||
this.CB_RegionName.Location = new System.Drawing.Point(77, 14);
|
||||
this.CB_RegionName.Location = new System.Drawing.Point(6, 84);
|
||||
this.CB_RegionName.Name = "CB_RegionName";
|
||||
this.CB_RegionName.Size = new System.Drawing.Size(138, 21);
|
||||
this.CB_RegionName.Size = new System.Drawing.Size(154, 20);
|
||||
this.CB_RegionName.TabIndex = 17;
|
||||
this.CB_RegionName.SelectedIndexChanged += new System.EventHandler(this.CB_RegionName_SelectedIndexChanged);
|
||||
//
|
||||
// TB_GameRev
|
||||
//
|
||||
this.TB_GameRev.Location = new System.Drawing.Point(24, 115);
|
||||
this.TB_GameRev.Name = "TB_GameRev";
|
||||
this.TB_GameRev.ReadOnly = true;
|
||||
this.TB_GameRev.Size = new System.Drawing.Size(124, 20);
|
||||
this.TB_GameRev.TabIndex = 16;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Location = new System.Drawing.Point(21, 99);
|
||||
this.label7.Location = new System.Drawing.Point(11, 48);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(82, 13);
|
||||
this.label7.Size = new System.Drawing.Size(59, 12);
|
||||
this.label7.TabIndex = 15;
|
||||
this.label7.Text = "Game Revision:";
|
||||
this.label7.Text = "Contents:";
|
||||
//
|
||||
// groupBox1
|
||||
//
|
||||
|
@ -265,18 +291,18 @@ namespace XCI_Explorer
|
|||
this.groupBox1.Controls.Add(this.B_ClearCert);
|
||||
this.groupBox1.Controls.Add(this.B_ImportCert);
|
||||
this.groupBox1.Controls.Add(this.B_ExportCert);
|
||||
this.groupBox1.Location = new System.Drawing.Point(22, 234);
|
||||
this.groupBox1.Location = new System.Drawing.Point(15, 230);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(301, 52);
|
||||
this.groupBox1.Size = new System.Drawing.Size(330, 49);
|
||||
this.groupBox1.TabIndex = 14;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "Cert";
|
||||
//
|
||||
// B_ViewCert
|
||||
//
|
||||
this.B_ViewCert.Location = new System.Drawing.Point(156, 19);
|
||||
this.B_ViewCert.Location = new System.Drawing.Point(168, 18);
|
||||
this.B_ViewCert.Name = "B_ViewCert";
|
||||
this.B_ViewCert.Size = new System.Drawing.Size(66, 23);
|
||||
this.B_ViewCert.Size = new System.Drawing.Size(74, 21);
|
||||
this.B_ViewCert.TabIndex = 3;
|
||||
this.B_ViewCert.Text = "View Cert";
|
||||
this.B_ViewCert.UseVisualStyleBackColor = true;
|
||||
|
@ -284,9 +310,9 @@ namespace XCI_Explorer
|
|||
//
|
||||
// B_ClearCert
|
||||
//
|
||||
this.B_ClearCert.Location = new System.Drawing.Point(229, 19);
|
||||
this.B_ClearCert.Location = new System.Drawing.Point(250, 18);
|
||||
this.B_ClearCert.Name = "B_ClearCert";
|
||||
this.B_ClearCert.Size = new System.Drawing.Size(66, 23);
|
||||
this.B_ClearCert.Size = new System.Drawing.Size(74, 21);
|
||||
this.B_ClearCert.TabIndex = 2;
|
||||
this.B_ClearCert.Text = "Clear Cert";
|
||||
this.B_ClearCert.UseVisualStyleBackColor = true;
|
||||
|
@ -294,9 +320,9 @@ namespace XCI_Explorer
|
|||
//
|
||||
// B_ImportCert
|
||||
//
|
||||
this.B_ImportCert.Location = new System.Drawing.Point(83, 19);
|
||||
this.B_ImportCert.Location = new System.Drawing.Point(86, 18);
|
||||
this.B_ImportCert.Name = "B_ImportCert";
|
||||
this.B_ImportCert.Size = new System.Drawing.Size(67, 23);
|
||||
this.B_ImportCert.Size = new System.Drawing.Size(74, 21);
|
||||
this.B_ImportCert.TabIndex = 1;
|
||||
this.B_ImportCert.Text = "Import Cert";
|
||||
this.B_ImportCert.UseVisualStyleBackColor = true;
|
||||
|
@ -304,9 +330,9 @@ namespace XCI_Explorer
|
|||
//
|
||||
// B_ExportCert
|
||||
//
|
||||
this.B_ExportCert.Location = new System.Drawing.Point(7, 19);
|
||||
this.B_ExportCert.Location = new System.Drawing.Point(6, 18);
|
||||
this.B_ExportCert.Name = "B_ExportCert";
|
||||
this.B_ExportCert.Size = new System.Drawing.Size(70, 23);
|
||||
this.B_ExportCert.Size = new System.Drawing.Size(74, 21);
|
||||
this.B_ExportCert.TabIndex = 0;
|
||||
this.B_ExportCert.Text = "Export Cert";
|
||||
this.B_ExportCert.UseVisualStyleBackColor = true;
|
||||
|
@ -314,120 +340,120 @@ namespace XCI_Explorer
|
|||
//
|
||||
// TB_ExactUsedSpace
|
||||
//
|
||||
this.TB_ExactUsedSpace.Location = new System.Drawing.Point(166, 181);
|
||||
this.TB_ExactUsedSpace.Location = new System.Drawing.Point(152, 203);
|
||||
this.TB_ExactUsedSpace.Name = "TB_ExactUsedSpace";
|
||||
this.TB_ExactUsedSpace.ReadOnly = true;
|
||||
this.TB_ExactUsedSpace.Size = new System.Drawing.Size(157, 20);
|
||||
this.TB_ExactUsedSpace.Size = new System.Drawing.Size(152, 21);
|
||||
this.TB_ExactUsedSpace.TabIndex = 13;
|
||||
//
|
||||
// TB_ROMExactSize
|
||||
//
|
||||
this.TB_ROMExactSize.Location = new System.Drawing.Point(166, 154);
|
||||
this.TB_ROMExactSize.Location = new System.Drawing.Point(152, 178);
|
||||
this.TB_ROMExactSize.Name = "TB_ROMExactSize";
|
||||
this.TB_ROMExactSize.ReadOnly = true;
|
||||
this.TB_ROMExactSize.Size = new System.Drawing.Size(157, 20);
|
||||
this.TB_ROMExactSize.Size = new System.Drawing.Size(152, 21);
|
||||
this.TB_ROMExactSize.TabIndex = 12;
|
||||
//
|
||||
// TB_UsedSpace
|
||||
//
|
||||
this.TB_UsedSpace.Location = new System.Drawing.Point(91, 181);
|
||||
this.TB_UsedSpace.Location = new System.Drawing.Point(77, 203);
|
||||
this.TB_UsedSpace.Name = "TB_UsedSpace";
|
||||
this.TB_UsedSpace.ReadOnly = true;
|
||||
this.TB_UsedSpace.Size = new System.Drawing.Size(69, 20);
|
||||
this.TB_UsedSpace.Size = new System.Drawing.Size(69, 21);
|
||||
this.TB_UsedSpace.TabIndex = 11;
|
||||
//
|
||||
// TB_ROMSize
|
||||
//
|
||||
this.TB_ROMSize.Location = new System.Drawing.Point(91, 154);
|
||||
this.TB_ROMSize.Location = new System.Drawing.Point(77, 178);
|
||||
this.TB_ROMSize.Name = "TB_ROMSize";
|
||||
this.TB_ROMSize.ReadOnly = true;
|
||||
this.TB_ROMSize.Size = new System.Drawing.Size(69, 20);
|
||||
this.TB_ROMSize.Size = new System.Drawing.Size(69, 21);
|
||||
this.TB_ROMSize.TabIndex = 10;
|
||||
//
|
||||
// label6
|
||||
//
|
||||
this.label6.AutoSize = true;
|
||||
this.label6.Location = new System.Drawing.Point(18, 181);
|
||||
this.label6.Location = new System.Drawing.Point(4, 203);
|
||||
this.label6.Name = "label6";
|
||||
this.label6.Size = new System.Drawing.Size(67, 13);
|
||||
this.label6.Size = new System.Drawing.Size(71, 12);
|
||||
this.label6.TabIndex = 9;
|
||||
this.label6.Text = "Used space:";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(27, 157);
|
||||
this.label5.Location = new System.Drawing.Point(13, 181);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(58, 13);
|
||||
this.label5.Size = new System.Drawing.Size(59, 12);
|
||||
this.label5.TabIndex = 8;
|
||||
this.label5.Text = "ROM Size:";
|
||||
//
|
||||
// TB_MKeyRev
|
||||
//
|
||||
this.TB_MKeyRev.Location = new System.Drawing.Point(24, 68);
|
||||
this.TB_MKeyRev.Location = new System.Drawing.Point(191, 21);
|
||||
this.TB_MKeyRev.Name = "TB_MKeyRev";
|
||||
this.TB_MKeyRev.ReadOnly = true;
|
||||
this.TB_MKeyRev.Size = new System.Drawing.Size(124, 20);
|
||||
this.TB_MKeyRev.Size = new System.Drawing.Size(154, 21);
|
||||
this.TB_MKeyRev.TabIndex = 7;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(21, 52);
|
||||
this.label4.Location = new System.Drawing.Point(189, 6);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(104, 13);
|
||||
this.label4.Size = new System.Drawing.Size(119, 12);
|
||||
this.label4.TabIndex = 6;
|
||||
this.label4.Text = "MasterKey Revision:";
|
||||
//
|
||||
// TB_SDKVer
|
||||
//
|
||||
this.TB_SDKVer.Location = new System.Drawing.Point(238, 68);
|
||||
this.TB_SDKVer.Location = new System.Drawing.Point(258, 102);
|
||||
this.TB_SDKVer.Name = "TB_SDKVer";
|
||||
this.TB_SDKVer.ReadOnly = true;
|
||||
this.TB_SDKVer.Size = new System.Drawing.Size(69, 20);
|
||||
this.TB_SDKVer.Size = new System.Drawing.Size(87, 21);
|
||||
this.TB_SDKVer.TabIndex = 5;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(235, 52);
|
||||
this.label3.Location = new System.Drawing.Point(258, 87);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(70, 13);
|
||||
this.label3.Size = new System.Drawing.Size(77, 12);
|
||||
this.label3.TabIndex = 4;
|
||||
this.label3.Text = "SDK Version:";
|
||||
//
|
||||
// TB_Capacity
|
||||
//
|
||||
this.TB_Capacity.Location = new System.Drawing.Point(238, 23);
|
||||
this.TB_Capacity.Location = new System.Drawing.Point(258, 63);
|
||||
this.TB_Capacity.Name = "TB_Capacity";
|
||||
this.TB_Capacity.ReadOnly = true;
|
||||
this.TB_Capacity.Size = new System.Drawing.Size(69, 20);
|
||||
this.TB_Capacity.Size = new System.Drawing.Size(87, 21);
|
||||
this.TB_Capacity.TabIndex = 3;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(235, 7);
|
||||
this.label2.Location = new System.Drawing.Point(258, 48);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(51, 13);
|
||||
this.label2.Size = new System.Drawing.Size(59, 12);
|
||||
this.label2.TabIndex = 2;
|
||||
this.label2.Text = "Capacity:";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(21, 7);
|
||||
this.label1.Location = new System.Drawing.Point(12, 6);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(44, 13);
|
||||
this.label1.Size = new System.Drawing.Size(59, 12);
|
||||
this.label1.TabIndex = 1;
|
||||
this.label1.Text = "Title ID:";
|
||||
//
|
||||
// TB_TID
|
||||
//
|
||||
this.TB_TID.Location = new System.Drawing.Point(24, 23);
|
||||
this.TB_TID.Location = new System.Drawing.Point(15, 21);
|
||||
this.TB_TID.Name = "TB_TID";
|
||||
this.TB_TID.ReadOnly = true;
|
||||
this.TB_TID.Size = new System.Drawing.Size(124, 20);
|
||||
this.TB_TID.Size = new System.Drawing.Size(170, 21);
|
||||
this.TB_TID.TabIndex = 0;
|
||||
//
|
||||
// tabPage2
|
||||
|
@ -443,7 +469,7 @@ namespace XCI_Explorer
|
|||
this.tabPage2.Location = new System.Drawing.Point(4, 22);
|
||||
this.tabPage2.Name = "tabPage2";
|
||||
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.tabPage2.Size = new System.Drawing.Size(347, 459);
|
||||
this.tabPage2.Size = new System.Drawing.Size(356, 485);
|
||||
this.tabPage2.TabIndex = 1;
|
||||
this.tabPage2.Text = "Partitions";
|
||||
this.tabPage2.UseVisualStyleBackColor = true;
|
||||
|
@ -451,18 +477,18 @@ namespace XCI_Explorer
|
|||
// LB_HashedRegionSize
|
||||
//
|
||||
this.LB_HashedRegionSize.AutoSize = true;
|
||||
this.LB_HashedRegionSize.Location = new System.Drawing.Point(6, 416);
|
||||
this.LB_HashedRegionSize.Location = new System.Drawing.Point(6, 439);
|
||||
this.LB_HashedRegionSize.Name = "LB_HashedRegionSize";
|
||||
this.LB_HashedRegionSize.Size = new System.Drawing.Size(101, 13);
|
||||
this.LB_HashedRegionSize.Size = new System.Drawing.Size(107, 12);
|
||||
this.LB_HashedRegionSize.TabIndex = 7;
|
||||
this.LB_HashedRegionSize.Text = "HashedRegionSize:";
|
||||
//
|
||||
// LB_ActualHash
|
||||
//
|
||||
this.LB_ActualHash.AutoSize = true;
|
||||
this.LB_ActualHash.Location = new System.Drawing.Point(6, 443);
|
||||
this.LB_ActualHash.Location = new System.Drawing.Point(6, 464);
|
||||
this.LB_ActualHash.Name = "LB_ActualHash";
|
||||
this.LB_ActualHash.Size = new System.Drawing.Size(68, 13);
|
||||
this.LB_ActualHash.Size = new System.Drawing.Size(77, 12);
|
||||
this.LB_ActualHash.TabIndex = 6;
|
||||
this.LB_ActualHash.Text = "Actual Hash:";
|
||||
this.LB_ActualHash.DoubleClick += new System.EventHandler(this.LB_ActualHash_DoubleClick);
|
||||
|
@ -470,9 +496,9 @@ namespace XCI_Explorer
|
|||
// LB_ExpectedHash
|
||||
//
|
||||
this.LB_ExpectedHash.AutoSize = true;
|
||||
this.LB_ExpectedHash.Location = new System.Drawing.Point(6, 430);
|
||||
this.LB_ExpectedHash.Location = new System.Drawing.Point(6, 452);
|
||||
this.LB_ExpectedHash.Name = "LB_ExpectedHash";
|
||||
this.LB_ExpectedHash.Size = new System.Drawing.Size(73, 13);
|
||||
this.LB_ExpectedHash.Size = new System.Drawing.Size(77, 12);
|
||||
this.LB_ExpectedHash.TabIndex = 5;
|
||||
this.LB_ExpectedHash.Text = "Header Hash:";
|
||||
this.LB_ExpectedHash.DoubleClick += new System.EventHandler(this.LB_ExpectedHash_DoubleClick);
|
||||
|
@ -480,9 +506,9 @@ namespace XCI_Explorer
|
|||
// B_Extract
|
||||
//
|
||||
this.B_Extract.Enabled = false;
|
||||
this.B_Extract.Location = new System.Drawing.Point(296, 367);
|
||||
this.B_Extract.Location = new System.Drawing.Point(296, 394);
|
||||
this.B_Extract.Name = "B_Extract";
|
||||
this.B_Extract.Size = new System.Drawing.Size(48, 23);
|
||||
this.B_Extract.Size = new System.Drawing.Size(48, 21);
|
||||
this.B_Extract.TabIndex = 4;
|
||||
this.B_Extract.Text = "Extract";
|
||||
this.B_Extract.UseVisualStyleBackColor = true;
|
||||
|
@ -491,27 +517,27 @@ namespace XCI_Explorer
|
|||
// LB_DataSize
|
||||
//
|
||||
this.LB_DataSize.AutoSize = true;
|
||||
this.LB_DataSize.Location = new System.Drawing.Point(6, 403);
|
||||
this.LB_DataSize.Location = new System.Drawing.Point(6, 427);
|
||||
this.LB_DataSize.Name = "LB_DataSize";
|
||||
this.LB_DataSize.Size = new System.Drawing.Size(30, 13);
|
||||
this.LB_DataSize.Size = new System.Drawing.Size(35, 12);
|
||||
this.LB_DataSize.TabIndex = 3;
|
||||
this.LB_DataSize.Text = "Size:";
|
||||
//
|
||||
// LB_DataOffset
|
||||
//
|
||||
this.LB_DataOffset.AutoSize = true;
|
||||
this.LB_DataOffset.Location = new System.Drawing.Point(6, 390);
|
||||
this.LB_DataOffset.Location = new System.Drawing.Point(6, 415);
|
||||
this.LB_DataOffset.Name = "LB_DataOffset";
|
||||
this.LB_DataOffset.Size = new System.Drawing.Size(38, 13);
|
||||
this.LB_DataOffset.Size = new System.Drawing.Size(47, 12);
|
||||
this.LB_DataOffset.TabIndex = 2;
|
||||
this.LB_DataOffset.Text = "Offset:";
|
||||
//
|
||||
// LB_SelectedData
|
||||
//
|
||||
this.LB_SelectedData.AutoSize = true;
|
||||
this.LB_SelectedData.Location = new System.Drawing.Point(6, 367);
|
||||
this.LB_SelectedData.Location = new System.Drawing.Point(6, 394);
|
||||
this.LB_SelectedData.Name = "LB_SelectedData";
|
||||
this.LB_SelectedData.Size = new System.Drawing.Size(51, 13);
|
||||
this.LB_SelectedData.Size = new System.Drawing.Size(53, 12);
|
||||
this.LB_SelectedData.TabIndex = 1;
|
||||
this.LB_SelectedData.Text = "FileName";
|
||||
//
|
||||
|
@ -521,7 +547,7 @@ namespace XCI_Explorer
|
|||
this.TV_Partitions.HideSelection = false;
|
||||
this.TV_Partitions.Location = new System.Drawing.Point(3, 3);
|
||||
this.TV_Partitions.Name = "TV_Partitions";
|
||||
this.TV_Partitions.Size = new System.Drawing.Size(341, 361);
|
||||
this.TV_Partitions.Size = new System.Drawing.Size(350, 385);
|
||||
this.TV_Partitions.TabIndex = 0;
|
||||
this.TV_Partitions.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.TV_Partitions_AfterSelect);
|
||||
//
|
||||
|
@ -533,9 +559,9 @@ namespace XCI_Explorer
|
|||
// MainForm
|
||||
//
|
||||
this.AllowDrop = true;
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(362, 529);
|
||||
this.ClientSize = new System.Drawing.Size(370, 553);
|
||||
this.Controls.Add(this.TABC_Main);
|
||||
this.Controls.Add(this.TB_File);
|
||||
this.Controls.Add(this.B_LoadROM);
|
||||
|
@ -555,6 +581,7 @@ namespace XCI_Explorer
|
|||
this.tabPage2.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -591,7 +618,6 @@ namespace XCI_Explorer
|
|||
private TextBox TB_ROMSize;
|
||||
private Label label6;
|
||||
private Label label5;
|
||||
private TextBox TB_GameRev;
|
||||
private Label label7;
|
||||
private GroupBox groupBox1;
|
||||
private Button B_ClearCert;
|
||||
|
@ -617,5 +643,8 @@ namespace XCI_Explorer
|
|||
private Label LB_HashedRegionSize;
|
||||
private BackgroundWorker backgroundWorker1;
|
||||
private Button B_TrimXCI;
|
||||
private Label label11;
|
||||
private Label label12;
|
||||
private RichTextBox TB_GameRev;
|
||||
}
|
||||
}
|
|
@ -39,8 +39,8 @@ namespace XCI_Explorer
|
|||
"Portuguese",
|
||||
"Russian",
|
||||
"Korean",
|
||||
"Taiwanese",
|
||||
"Chinese",
|
||||
"Traditional Chinese",
|
||||
"Simplified Chinese",
|
||||
"???"
|
||||
};
|
||||
|
||||
|
@ -270,6 +270,19 @@ namespace XCI_Explorer
|
|||
TB_ProdCode.Text = "";
|
||||
TB_Name.Text = "";
|
||||
TB_Dev.Text = "";
|
||||
|
||||
int basenum = 0;
|
||||
int updnum = 0;
|
||||
int dlcnum = 0;
|
||||
string pversion = "";
|
||||
int patchflag = 0;
|
||||
int patchnum = 0;
|
||||
string patchver = "";
|
||||
int baseflag = 0;
|
||||
string[] basetitle = new string[5];
|
||||
string[] updtitle = new string[10];
|
||||
string[] dlctitle = new string[300];
|
||||
|
||||
PB_GameIcon.BackgroundImage = null;
|
||||
Array.Clear(Icons, 0, Icons.Length);
|
||||
TV_Partitions.Nodes.Clear();
|
||||
|
@ -294,6 +307,8 @@ namespace XCI_Explorer
|
|||
TB_ROMSize.Text = $"{num_fs:0.##} {array_fs[num2_fs]}";
|
||||
TB_UsedSpace.Text = TB_ROMSize.Text;
|
||||
|
||||
LoadNSPPartitions();
|
||||
|
||||
Process process = new Process();
|
||||
try
|
||||
{
|
||||
|
@ -335,8 +350,6 @@ namespace XCI_Explorer
|
|||
array3[n].Name = new string(chars.ToArray());
|
||||
chars.Clear();
|
||||
|
||||
// Console.WriteLine("FC: " + PFS0.PFS0_Headers[0].FileCount.ToString() + " Name: " + array3[n].Name);
|
||||
|
||||
if (array3[n].Name.EndsWith(".cnmt.xml"))
|
||||
{
|
||||
byte[] array4 = new byte[array3[n].Size];
|
||||
|
@ -344,25 +357,37 @@ namespace XCI_Explorer
|
|||
fileStream.Read(array4, 0, (int)array3[n].Size);
|
||||
|
||||
XDocument xml = XDocument.Parse(Encoding.UTF8.GetString(array4));
|
||||
TB_TID.Text = xml.Element("ContentMeta").Element("Id").Value.Remove(1, 2).ToUpper();
|
||||
contentType = xml.Element("ContentMeta").Element("Type").Value;
|
||||
if (contentType == "Patch")
|
||||
xmlVersion = "v" + xml.Element("ContentMeta").Element("Version").Value;
|
||||
TB_TID.Text = xml.Element("ContentMeta").Element("Id").Value.Remove(1, 2).ToUpper(); //id
|
||||
pversion = xml.Element("ContentMeta").Element("Version").Value; //version
|
||||
contentType = xml.Element("ContentMeta").Element("Type").Value; //content
|
||||
|
||||
/*string titleIDBaseGame = TB_TID.Text;
|
||||
if (contentType != "Application") {
|
||||
string titleIdBase = TB_TID.Text.Substring(0, 13);
|
||||
if (contentType == "Patch") //UPDATE
|
||||
if (contentType == "Patch")
|
||||
{
|
||||
patchflag = 1;
|
||||
if (System.Convert.ToInt32(pversion) > patchnum)
|
||||
{
|
||||
titleIDBaseGame = titleIdBase + "000";
|
||||
patchnum = System.Convert.ToInt32(pversion);
|
||||
xmlVersion = "v" + xml.Element("ContentMeta").Element("Version").Value;
|
||||
int number = System.Convert.ToInt32(pversion);
|
||||
patchver = "v" + System.Convert.ToString((double)number / 65536);
|
||||
}
|
||||
else //DLC
|
||||
{
|
||||
long tmp = long.Parse(titleIdBase, System.Globalization.NumberStyles.HexNumber) - 1;
|
||||
titleIDBaseGame = string.Format("0{0:X8}", tmp) + "000";
|
||||
}
|
||||
}*/
|
||||
//data.TitleIDBaseGame = titleIDBaseGame;
|
||||
|
||||
updtitle[updnum] = "[" + TB_TID.Text + "]" + "[v" + pversion + "]";
|
||||
updnum++;
|
||||
}
|
||||
else if (contentType == "Application")
|
||||
{
|
||||
baseflag = 1;
|
||||
if (patchflag != 1) xmlVersion = "v" + xml.Element("ContentMeta").Element("Version").Value;
|
||||
basetitle[basenum] = "[" + TB_TID.Text + "]" + "[v" + pversion + "]";
|
||||
basenum++;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (baseflag == 0 && patchflag == 0) xmlVersion = "v" + xml.Element("ContentMeta").Element("Version").Value;
|
||||
dlctitle[dlcnum] = "[" + TB_TID.Text + "]" + "[v" + pversion + "]";
|
||||
dlcnum++;
|
||||
}
|
||||
|
||||
if (contentType != "AddOnContent")
|
||||
{
|
||||
|
@ -472,19 +497,37 @@ namespace XCI_Explorer
|
|||
byte[] TitleID = BitConverter.GetBytes(array7[0].TitleID);
|
||||
Array.Reverse(TitleID);
|
||||
TB_TID.Text = BitConverter.ToString(TitleID).Replace("-", "");
|
||||
xmlVersion = "v" + array7[0].TitleVersion.ToString();
|
||||
|
||||
if (array7[0].Type == (byte)CNMT.CNMT_Header.TitleType.REGULAR_APPLICATION)
|
||||
{
|
||||
contentType = "Application";
|
||||
baseflag = 1;
|
||||
if (patchflag != 1) xmlVersion = "v" + array7[0].TitleVersion.ToString();
|
||||
basetitle[basenum] = "[" + TB_TID.Text + "]" + "[v" + array7[0].TitleVersion.ToString() + "]";
|
||||
basenum++;
|
||||
}
|
||||
else if (array7[0].Type == (byte)CNMT.CNMT_Header.TitleType.UPDATE_TITLE)
|
||||
{
|
||||
contentType = "Patch";
|
||||
|
||||
patchflag = 1;
|
||||
if (array7[0].TitleVersion > patchnum)
|
||||
{
|
||||
patchnum = array7[0].TitleVersion;
|
||||
xmlVersion = "v" + array7[0].TitleVersion.ToString();
|
||||
int number = System.Convert.ToInt32(array7[0].TitleVersion);
|
||||
patchver = "v" + System.Convert.ToString((double)number / 65536);
|
||||
}
|
||||
|
||||
updtitle[updnum] = "[" + TB_TID.Text + "]" + "[v" + array7[0].TitleVersion.ToString() + "]";
|
||||
updnum++;
|
||||
}
|
||||
else if (array7[0].Type == (byte)CNMT.CNMT_Header.TitleType.ADD_ON_CONTENT)
|
||||
{
|
||||
if (baseflag == 0 && patchflag == 0) xmlVersion = "v" + array7[0].TitleVersion.ToString();
|
||||
contentType = "AddOnContent";
|
||||
dlctitle[dlcnum] = "[" + TB_TID.Text + "]" + "[v" + array7[0].TitleVersion.ToString() + "]";
|
||||
dlcnum++;
|
||||
}
|
||||
|
||||
fileStream3.Position = array7[0].Offset + 32;
|
||||
|
@ -581,12 +624,60 @@ namespace XCI_Explorer
|
|||
}
|
||||
if (xmlVersion.Trim() == "")
|
||||
{
|
||||
TB_GameRev.Text = NACP.NACP_Datas[0].GameVer.Replace("\0", "");
|
||||
TB_GameRev.Text = "GENERAL:" + System.Environment.NewLine + " (" + NACP.NACP_Datas[0].GameVer.Replace("\0", "") + ")" + System.Environment.NewLine;
|
||||
}
|
||||
else
|
||||
{
|
||||
TB_GameRev.Text = xmlVersion + " (" + NACP.NACP_Datas[0].GameVer.Replace("\0", "") + ")";
|
||||
string cache;
|
||||
|
||||
if (patchflag == 1)
|
||||
cache = "GENERAL:" + System.Environment.NewLine + xmlVersion + " (" + patchver + ")" + System.Environment.NewLine;
|
||||
else
|
||||
cache = "GENERAL:" + System.Environment.NewLine + xmlVersion + " (" + NACP.NACP_Datas[0].GameVer.Replace("\0", "") + ")" + System.Environment.NewLine;
|
||||
|
||||
if (basenum != 0)
|
||||
{
|
||||
cache = cache + "BASE:" + System.Environment.NewLine;
|
||||
for (int i = 0; i < basenum; i++)
|
||||
{
|
||||
cache = cache + basetitle[i] + System.Environment.NewLine;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cache = cache + "BASE:" + System.Environment.NewLine + "EMPTY" + System.Environment.NewLine;
|
||||
}
|
||||
if (updnum != 0)
|
||||
{
|
||||
cache = cache + "UPD:" + System.Environment.NewLine;
|
||||
for (int i = 0; i < updnum; i++)
|
||||
{
|
||||
cache = cache + updtitle[i] + System.Environment.NewLine;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cache = cache + "UPD:" + System.Environment.NewLine + "EMPTY" + System.Environment.NewLine;
|
||||
}
|
||||
if (dlcnum != 0)
|
||||
{
|
||||
cache = cache + "DLC:" + System.Environment.NewLine;
|
||||
for (int i = 0; i < dlcnum; i++)
|
||||
{
|
||||
if (i < dlcnum - 1)
|
||||
cache = cache + dlctitle[i] + System.Environment.NewLine;
|
||||
else
|
||||
cache = cache + dlctitle[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cache = cache + "DLC:" + System.Environment.NewLine + "EMPTY";
|
||||
}
|
||||
TB_GameRev.Text = cache;
|
||||
label12.Text = basenum.ToString() + " BASE, " + updnum.ToString() + " UPD, " + dlcnum.ToString() + " DLC";
|
||||
}
|
||||
|
||||
TB_ProdCode.Text = NACP.NACP_Datas[0].GameProd.Replace("\0", "");
|
||||
if (TB_ProdCode.Text == "")
|
||||
{
|
||||
|
@ -612,12 +703,64 @@ namespace XCI_Explorer
|
|||
}
|
||||
catch { }
|
||||
|
||||
/*if (contentType == "Patch") {
|
||||
}*/
|
||||
}
|
||||
else
|
||||
{
|
||||
TB_GameRev.Text = "";
|
||||
if (xmlVersion.Trim() == "")
|
||||
{
|
||||
TB_GameRev.Text = "GENERAL:" + System.Environment.NewLine + System.Environment.NewLine;
|
||||
}
|
||||
else
|
||||
{
|
||||
string cache;
|
||||
|
||||
if (patchflag == 1)
|
||||
cache = "GENERAL:" + System.Environment.NewLine + xmlVersion + " (" + patchver + ")" + System.Environment.NewLine;
|
||||
else
|
||||
cache = "GENERAL:" + System.Environment.NewLine + xmlVersion + System.Environment.NewLine;
|
||||
|
||||
if (basenum != 0)
|
||||
{
|
||||
cache = cache + "BASE:" + System.Environment.NewLine;
|
||||
for (int i = 0; i < basenum; i++)
|
||||
{
|
||||
cache = cache + basetitle[i] + System.Environment.NewLine;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cache = cache + "BASE:" + System.Environment.NewLine + "EMPTY" + System.Environment.NewLine;
|
||||
}
|
||||
if (updnum != 0)
|
||||
{
|
||||
cache = cache + "UPD:" + System.Environment.NewLine;
|
||||
for (int i = 0; i < updnum; i++)
|
||||
{
|
||||
cache = cache + updtitle[i] + System.Environment.NewLine;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cache = cache + "UPD:" + System.Environment.NewLine + "EMPTY" + System.Environment.NewLine;
|
||||
}
|
||||
if (dlcnum != 0)
|
||||
{
|
||||
cache = cache + "DLC:" + System.Environment.NewLine;
|
||||
for (int i = 0; i < dlcnum; i++)
|
||||
{
|
||||
if (i < dlcnum - 1)
|
||||
cache = cache + dlctitle[i] + System.Environment.NewLine;
|
||||
else
|
||||
cache = cache + dlctitle[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cache = cache + "DLC:" + System.Environment.NewLine + "EMPTY";
|
||||
}
|
||||
TB_GameRev.Text = cache;
|
||||
label12.Text = basenum.ToString() + " BASE, " + updnum.ToString() + " UPD, " + dlcnum.ToString() + " DLC";
|
||||
}
|
||||
TB_ProdCode.Text = "No Prod. ID";
|
||||
}
|
||||
|
||||
|
@ -703,6 +846,20 @@ namespace XCI_Explorer
|
|||
TB_Name.Text = "";
|
||||
TB_Dev.Text = "";
|
||||
PB_GameIcon.BackgroundImage = null;
|
||||
|
||||
int basenum = 0;
|
||||
int updnum = 0;
|
||||
int dlcnum = 0;
|
||||
int patchflag = 0;
|
||||
int patchnum = 0;
|
||||
string patchver = "";
|
||||
int baseflag = 0;
|
||||
string[] basetitle = new string[5];
|
||||
string[] updtitle = new string[10];
|
||||
string[] dlctitle = new string[300];
|
||||
string xmlVersion = "";
|
||||
string saveTID = "";
|
||||
|
||||
Array.Clear(Icons, 0, Icons.Length);
|
||||
if (getMKey())
|
||||
{
|
||||
|
@ -738,17 +895,19 @@ namespace XCI_Explorer
|
|||
fileStream2.Close();
|
||||
}
|
||||
|
||||
Process process = new Process();
|
||||
process.StartInfo = new ProcessStartInfo
|
||||
Process process1 = new Process();
|
||||
process1.StartInfo = new ProcessStartInfo
|
||||
{
|
||||
WindowStyle = ProcessWindowStyle.Hidden,
|
||||
FileName = $"tools{Path.DirectorySeparatorChar}hactool.exe",
|
||||
//FileName = "tools\\hactool.exe",
|
||||
Arguments = "-k keys.txt --section0dir=data meta"
|
||||
};
|
||||
process.Start();
|
||||
process.WaitForExit();
|
||||
process1.Start();
|
||||
process1.WaitForExit();
|
||||
|
||||
string[] cnmt = Directory.GetFiles("data", "*.cnmt");
|
||||
|
||||
if (cnmt.Length != 0)
|
||||
{
|
||||
using (FileStream fileStream3 = File.OpenRead(cnmt[0]))
|
||||
|
@ -760,19 +919,50 @@ namespace XCI_Explorer
|
|||
fileStream3.Read(buffer, 0, 32);
|
||||
array7[0] = new CNMT.CNMT_Header(buffer);
|
||||
|
||||
byte[] TitleID = BitConverter.GetBytes(array7[0].TitleID);
|
||||
Array.Reverse(TitleID);
|
||||
saveTID = BitConverter.ToString(TitleID).Replace("-", "");
|
||||
|
||||
if (array7[0].Type == (byte)CNMT.CNMT_Header.TitleType.REGULAR_APPLICATION)
|
||||
{
|
||||
baseflag = 1;
|
||||
if (patchflag != 1) xmlVersion = "v" + array7[0].TitleVersion.ToString();
|
||||
basetitle[basenum] = "[" + saveTID + "]" + "[v" + array7[0].TitleVersion.ToString() + "]";
|
||||
basenum++;
|
||||
}
|
||||
else if (array7[0].Type == (byte)CNMT.CNMT_Header.TitleType.UPDATE_TITLE)
|
||||
{
|
||||
patchflag = 1;
|
||||
if (array7[0].TitleVersion > patchnum)
|
||||
{
|
||||
patchnum = array7[0].TitleVersion;
|
||||
xmlVersion = "v" + array7[0].TitleVersion.ToString();
|
||||
int number = System.Convert.ToInt32(array7[0].TitleVersion);
|
||||
patchver = "v" + System.Convert.ToString((double)number / 65536);
|
||||
}
|
||||
|
||||
updtitle[updnum] = "[" + saveTID + "]" + "[v" + array7[0].TitleVersion.ToString() + "]";
|
||||
updnum++;
|
||||
}
|
||||
else if (array7[0].Type == (byte)CNMT.CNMT_Header.TitleType.ADD_ON_CONTENT)
|
||||
{
|
||||
if (patchflag == 0 && baseflag == 0) xmlVersion = "v" + array7[0].TitleVersion.ToString();
|
||||
dlctitle[dlcnum] = "[" + saveTID + "]" + "[v" + array7[0].TitleVersion.ToString() + "]";
|
||||
dlcnum++;
|
||||
}
|
||||
|
||||
fileStream3.Position = array7[0].Offset + 32;
|
||||
CNMT.CNMT_Entry[] array9 = new CNMT.CNMT_Entry[array7[0].ContentCount];
|
||||
for (int k = 0; k < array7[0].ContentCount; k++)
|
||||
{
|
||||
fileStream3.Read(buffer2, 0, 56);
|
||||
array9[k] = new CNMT.CNMT_Entry(buffer2);
|
||||
if (array9[k].Type == (byte)CNMT.CNMT_Entry.ContentType.CONTROL)
|
||||
if (array9[k].Type == (byte)CNMT.CNMT_Entry.ContentType.CONTROL || array9[k].Type == (byte)CNMT.CNMT_Entry.ContentType.DATA)
|
||||
{
|
||||
ncaTarget.Add(BitConverter.ToString(array9[k].NcaId).ToLower().Replace("-", "") + ".nca");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
fileStream3.Close();
|
||||
}
|
||||
}
|
||||
|
@ -806,6 +996,7 @@ namespace XCI_Explorer
|
|||
fileStream2.Close();
|
||||
}
|
||||
|
||||
|
||||
Process process = new Process();
|
||||
process.StartInfo = new ProcessStartInfo
|
||||
{
|
||||
|
@ -868,7 +1059,54 @@ namespace XCI_Explorer
|
|||
}
|
||||
}
|
||||
|
||||
TB_GameRev.Text = GameRevision;
|
||||
string cache;
|
||||
if (patchflag == 1)
|
||||
cache = "GENERAL:" + System.Environment.NewLine + xmlVersion + " (" + patchver + ")" + System.Environment.NewLine;
|
||||
else
|
||||
cache = "GENERAL:" + System.Environment.NewLine + xmlVersion + " (" + NACP.NACP_Datas[0].GameVer.Replace("\0", "") + ")" + System.Environment.NewLine;
|
||||
|
||||
if (basenum != 0)
|
||||
{
|
||||
cache = cache + "BASE:" + System.Environment.NewLine;
|
||||
for (int i = 0; i < basenum; i++)
|
||||
{
|
||||
cache = cache + basetitle[i] + System.Environment.NewLine;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cache = cache + "BASE:" + System.Environment.NewLine + "EMPTY" + System.Environment.NewLine;
|
||||
}
|
||||
if (updnum != 0)
|
||||
{
|
||||
cache = cache + "UPD:" + System.Environment.NewLine;
|
||||
for (int i = 0; i < updnum; i++)
|
||||
{
|
||||
cache = cache + updtitle[i] + System.Environment.NewLine;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cache = cache + "UPD:" + System.Environment.NewLine + "EMPTY" + System.Environment.NewLine;
|
||||
}
|
||||
if (dlcnum != 0)
|
||||
{
|
||||
cache = cache + "DLC:" + System.Environment.NewLine;
|
||||
for (int i = 0; i < dlcnum; i++)
|
||||
{
|
||||
if (i < dlcnum - 1)
|
||||
cache = cache + dlctitle[i] + System.Environment.NewLine;
|
||||
else
|
||||
cache = cache + dlctitle[i];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cache = cache + "DLC:" + System.Environment.NewLine + "EMPTY";
|
||||
}
|
||||
TB_GameRev.Text = cache;
|
||||
label12.Text = basenum.ToString() + " BASE, " + updnum.ToString() + " UPD, " + dlcnum.ToString() + " DLC";
|
||||
|
||||
CB_RegionName.SelectedIndex = 0;
|
||||
|
||||
fileStream.Close();
|
||||
|
@ -1069,6 +1307,65 @@ namespace XCI_Explorer
|
|||
fileStream.Close();
|
||||
}
|
||||
|
||||
|
||||
private void LoadNSPPartitions()
|
||||
{
|
||||
long offset;
|
||||
|
||||
TV_Partitions.Nodes.Clear();
|
||||
TV_Parti = new TreeViewFileSystem(TV_Partitions);
|
||||
rootNode = new BetterTreeNode("root");
|
||||
rootNode.Offset = -1L;
|
||||
rootNode.Size = -1L;
|
||||
TV_Partitions.Nodes.Add(rootNode);
|
||||
|
||||
|
||||
// Maximum number of files in NSP to read in
|
||||
const int MAXFILES = 250;
|
||||
|
||||
FileStream fileStream = File.OpenRead(TB_File.Text);
|
||||
List<char> chars = new List<char>();
|
||||
byte[] array = new byte[16];
|
||||
byte[] array2 = new byte[24];
|
||||
fileStream.Read(array, 0, 16);
|
||||
PFS0.PFS0_Headers[0] = new PFS0.PFS0_Header(array);
|
||||
if (!PFS0.PFS0_Headers[0].Magic.Contains("PFS0"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
PFS0.PFS0_Entry[] array3;
|
||||
array3 = new PFS0.PFS0_Entry[Math.Max(PFS0.PFS0_Headers[0].FileCount, MAXFILES)]; //Dump of TitleID 01009AA000FAA000 reports more than 10000000 files here, so it breaks the program. Standard is to have only 20 files
|
||||
for (int m = 0; m < PFS0.PFS0_Headers[0].FileCount; m++)
|
||||
{
|
||||
fileStream.Position = 16 + 24 * m;
|
||||
fileStream.Read(array2, 0, 24);
|
||||
array3[m] = new PFS0.PFS0_Entry(array2);
|
||||
|
||||
if (m == MAXFILES - 1) //Dump of TitleID 01009AA000FAA000 reports more than 10000000 files here, so it breaks the program. Standard is to have only 20 files
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int n = 0; n < PFS0.PFS0_Headers[0].FileCount; n++)
|
||||
{
|
||||
fileStream.Position = 16 + 24 * PFS0.PFS0_Headers[0].FileCount + array3[n].Name_ptr;
|
||||
int num4;
|
||||
while ((num4 = fileStream.ReadByte()) != 0 && num4 != 0)
|
||||
{
|
||||
chars.Add((char)num4);
|
||||
}
|
||||
array3[n].Name = new string(chars.ToArray());
|
||||
chars.Clear();
|
||||
offset = 16 + 24 * PFS0.PFS0_Headers[0].FileCount + PFS0.PFS0_Headers[0].StringTableSize + array3[n].Offset;
|
||||
fileStream.Position = offset;
|
||||
|
||||
TV_Parti.AddFile(array3[n].Name, rootNode, offset, array3[n].Size);
|
||||
}
|
||||
|
||||
fileStream.Close();
|
||||
}
|
||||
|
||||
|
||||
private void TV_Partitions_AfterSelect(object sender, TreeViewEventArgs e)
|
||||
{
|
||||
BetterTreeNode betterTreeNode = (BetterTreeNode)TV_Partitions.SelectedNode;
|
||||
|
@ -1431,6 +1728,31 @@ namespace XCI_Explorer
|
|||
}
|
||||
}
|
||||
|
||||
private void TABP_XCI_DragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
if (backgroundWorker1.IsBusy != true)
|
||||
{
|
||||
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
|
||||
TB_File.Text = files[0];
|
||||
ProcessFile();
|
||||
}
|
||||
}
|
||||
|
||||
private void TABP_XCI_DragEnter(object sender, DragEventArgs e)
|
||||
{
|
||||
if (backgroundWorker1.IsBusy != true)
|
||||
{
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
||||
{
|
||||
e.Effect = DragDropEffects.Copy;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Effect = DragDropEffects.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
|
||||
{
|
||||
BackgroundWorker worker = sender as BackgroundWorker;
|
||||
|
@ -1443,14 +1765,29 @@ namespace XCI_Explorer
|
|||
new BinaryReader(fileStream);
|
||||
new BinaryWriter(fileStream2);
|
||||
fileStream.Position = selectedOffset;
|
||||
byte[] buffer = new byte[8192];
|
||||
long num = selectedSize;
|
||||
int num2;
|
||||
while ((num2 = fileStream.Read(buffer, 0, 8192)) > 0 && num > 0)
|
||||
|
||||
if (selectedSize < 10000)
|
||||
{
|
||||
fileStream2.Write(buffer, 0, num2);
|
||||
num -= num2;
|
||||
byte[] buffer = new byte[1];
|
||||
int num2;
|
||||
while ((num2 = fileStream.Read(buffer, 0, 1)) > 0 && num > 0)
|
||||
{
|
||||
fileStream2.Write(buffer, 0, num2);
|
||||
num -= num2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
byte[] buffer = new byte[8192];
|
||||
int num2;
|
||||
while ((num2 = fileStream.Read(buffer, 0, 8192)) > 0 && num > 0)
|
||||
{
|
||||
fileStream2.Write(buffer, 0, num2);
|
||||
num -= num2;
|
||||
}
|
||||
}
|
||||
|
||||
fileStream.Close();
|
||||
}
|
||||
}
|
||||
|
@ -1473,5 +1810,16 @@ namespace XCI_Explorer
|
|||
MessageBox.Show("Done extracting NCA!");
|
||||
}
|
||||
}
|
||||
|
||||
private void TABP_XCI_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void label11_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue