From 70ce26fcd20f4e1c1be75849885afdf063f6cff8 Mon Sep 17 00:00:00 2001 From: StudentBlake <6874208+StudentBlake@users.noreply.github.com> Date: Tue, 31 Jul 2018 12:35:05 -0400 Subject: [PATCH] Sped up NSP loading (nstoolmod), folder restructure, view cert shows directory of file --- Properties/AssemblyInfo.cs | 4 ++-- XCI_Explorer/MainForm.cs | 35 +++++++++++++++++++++++++---------- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 74336ea..3ede010 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -16,5 +16,5 @@ using System.Runtime.Versioning; [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("206c6c47-87b1-477f-b6e6-f7e7c1a92f8f")] -[assembly: AssemblyFileVersion("1.3.0.0")] -[assembly: AssemblyVersion("1.3.0.0")] +[assembly: AssemblyFileVersion("1.4.0.0")] +[assembly: AssemblyVersion("1.4.0.0")] diff --git a/XCI_Explorer/MainForm.cs b/XCI_Explorer/MainForm.cs index ef1fa8e..3914018 100644 --- a/XCI_Explorer/MainForm.cs +++ b/XCI_Explorer/MainForm.cs @@ -124,20 +124,27 @@ namespace XCI_Explorer { Directory.SetCurrentDirectory(startupPath); if (!File.Exists("keys.txt")) { - if (MessageBox.Show("keys.txt is missing.\nDo you want to automatically download it now?\n\nBy pressing 'Yes' you agree that you own these keys.", "XCI Explorer", MessageBoxButtons.YesNo) == DialogResult.Yes) { + if (MessageBox.Show("keys.txt is missing.\nDo you want to automatically download it now?\n\nBy pressing 'Yes' you agree that you own these keys.\n", "XCI Explorer", MessageBoxButtons.YesNo) == DialogResult.Yes) { using (var client = new WebClient()) { - client.DownloadFile(Util.Base64Decode("aHR0cHM6Ly9wYXN0ZWJpbi5jb20vcmF3L2RTMUtjbm0y"), "keys.txt"); + client.DownloadFile(Util.Base64Decode("aHR0cHM6Ly9wYXN0ZWJpbi5jb20vcmF3L1RXdUtLaWhK"), "keys.txt"); } } if (!File.Exists("keys.txt")) { - MessageBox.Show("keys.txt failed to load.\nPlease include keys.txt in this location."); + MessageBox.Show("keys.txt failed to load.\nPlease include keys.txt in the root folder."); Environment.Exit(0); } } - if (!File.Exists("hactool.exe")) { - MessageBox.Show("hactool.exe is missing."); + if (!File.Exists("tools\\hactool.exe")) { + Directory.CreateDirectory("tools"); + MessageBox.Show("hactool.exe is missing.\nPlease include hactool.exe in the 'tools' folder."); + Environment.Exit(0); + } + + if (!File.Exists("tools\\nstoolmod.exe")) { + Directory.CreateDirectory("tools"); + MessageBox.Show("nstoolmod.exe is missing.\nPlease include nstoolmod.exe in the 'tools' folder."); Environment.Exit(0); } @@ -276,10 +283,16 @@ namespace XCI_Explorer { Process process = new Process(); try { - process.StartInfo = new ProcessStartInfo { + /*process.StartInfo = new ProcessStartInfo { WindowStyle = ProcessWindowStyle.Hidden, FileName = "hactool.exe", Arguments = "-t pfs0 " + "\"" + TB_File.Text + "\"" + " --outdir=tmp" + };*/ + // Using a modified version of NXTools (nstool) to only extract NCA under 10 MB + process.StartInfo = new ProcessStartInfo { + WindowStyle = ProcessWindowStyle.Hidden, + FileName = "tools\\nstoolmod.exe", + Arguments = "--fsdir tmp \"" + TB_File.Text + "\"" }; process.Start(); process.WaitForExit(); @@ -309,7 +322,7 @@ namespace XCI_Explorer { process = new Process(); process.StartInfo = new ProcessStartInfo { WindowStyle = ProcessWindowStyle.Hidden, - FileName = "hactool.exe", + FileName = "tools\\hactool.exe", Arguments = "-k keys.txt --romfsdir=tmp tmp/" + ncaTarget }; process.Start(); @@ -361,7 +374,7 @@ namespace XCI_Explorer { process = new Process(); process.StartInfo = new ProcessStartInfo { WindowStyle = ProcessWindowStyle.Hidden, - FileName = "hactool.exe", + FileName = "tools\\hactool.exe", Arguments = "-k keys.txt tmp/" + ncaTarget, RedirectStandardOutput = true, UseShellExecute = false, @@ -432,7 +445,7 @@ namespace XCI_Explorer { Process process = new Process(); process.StartInfo = new ProcessStartInfo { WindowStyle = ProcessWindowStyle.Hidden, - FileName = "hactool.exe", + FileName = "tools\\hactool.exe", Arguments = "-k keys.txt --romfsdir=data meta" }; process.Start(); @@ -857,7 +870,9 @@ namespace XCI_Explorer { private void B_ViewCert_Click(object sender, EventArgs e) { if (Util.checkFile(TB_File.Text)) { - new CertForm(this).Show(); + CertForm cert = new CertForm(this); + cert.Text = "Cert Data - " + TB_File.Text; + cert.Show(); } else { MessageBox.Show("File not found");