Fixed IOS patching

Unchecking all IOS patches now also unchecks main IOS patch checkbox
Increased size of header, in hope that the date won't be cut off...
Changed TODO list stuff

VERIFIED UNDER:
Windows

TO VERIFY:
Linux (not sure if outputting WADs correctly, should be checked)
Mac OS X (not such a priority, as mono can be quite hard to set up on OS X)
This commit is contained in:
gb.luke 2010-07-09 17:54:13 +00:00
parent c27c71899c
commit 5ba688d4c3
7 changed files with 96 additions and 32 deletions

View File

@ -1,4 +1,11 @@
using System; ///////////////////////////////////////////
// NUS Downloader: Database.cs //
// $Rev:: $ //
// $Author:: $ //
// $Date:: $ //
///////////////////////////////////////////
using System;
using System.Windows.Forms; using System.Windows.Forms;
using System.IO; using System.IO;
using System.Xml; using System.Xml;

View File

@ -1,4 +1,11 @@
namespace NUS_Downloader ///////////////////////////////////////////
// NUS Downloader: Form1.Designer.cs //
// $Rev:: $ //
// $Author:: $ //
// $Date:: $ //
///////////////////////////////////////////
namespace NUS_Downloader
{ {
partial class Form1 partial class Form1
{ {

View File

@ -1,9 +1,9 @@
/////////////////////////////////////// ///////////////////////////////////////////
// NUS Downloader: Form1.cs // // NUS Downloader: Form1.cs //
// $Rev:: $ // // $Rev:: $ //
// $Author:: $ // // $Author:: $ //
// $Date:: $ // // $Date:: $ //
/////////////////////////////////////// ///////////////////////////////////////////
/////////////////////////////////////// ///////////////////////////////////////
// Copyright (C) 2010 // Copyright (C) 2010
@ -515,9 +515,13 @@ namespace NUS_Downloader
} }
if (iosPatchCheckbox.Checked == true) { // Apply patches then... if (iosPatchCheckbox.Checked == true) { // Apply patches then...
bool didpatch = false;
int noofpatches = 0;
string appendpatch = "";
// Okay, it's checked. // Okay, it's checked.
libWiiSharp.IosPatcher iosp = new libWiiSharp.IosPatcher(); libWiiSharp.IosPatcher iosp = new libWiiSharp.IosPatcher();
libWiiSharp.WAD ioswad = new libWiiSharp.WAD(); libWiiSharp.WAD ioswad = new libWiiSharp.WAD();
wadName = wadName.Replace("[v]", nusClient.TitleVersion.ToString());
if (wadName.Contains(Path.DirectorySeparatorChar.ToString()) || wadName.Contains(Path.AltDirectorySeparatorChar.ToString())) if (wadName.Contains(Path.DirectorySeparatorChar.ToString()) || wadName.Contains(Path.AltDirectorySeparatorChar.ToString()))
ioswad.LoadFile(wadName); ioswad.LoadFile(wadName);
else else
@ -537,20 +541,47 @@ namespace NUS_Downloader
if (iosPatchesListBox.GetItemCheckState(iosPatchesListBox.Items.IndexOf(checkItem)).ToString() == "Checked") { if (iosPatchesListBox.GetItemCheckState(iosPatchesListBox.Items.IndexOf(checkItem)).ToString() == "Checked") {
switch (checkItem.ToString()) { switch (checkItem.ToString()) {
case "Trucha bug": case "Trucha bug":
if (iosp.PatchFakeSigning() > 0) noofpatches = iosp.PatchFakeSigning();
WriteStatus(" - Patched in fake-signing"); if (noofpatches > 0)
{
WriteStatus(" - Patched in fake-signing:");
if (noofpatches > 1)
appendpatch = "es";
else
appendpatch = "";
WriteStatus(String.Format(" {0} patch{1} applied.", noofpatches, appendpatch));
didpatch = true;
}
else else
WriteStatus(" - Could not patch fake-signing"); WriteStatus(" - Could not patch fake-signing");
break; break;
case "ES_Identify": case "ES_Identify":
if (iosp.PatchEsIdentify() > 0) noofpatches = iosp.PatchEsIdentify();
if (noofpatches > 0)
{
WriteStatus(" - Patched in ES_Identify"); WriteStatus(" - Patched in ES_Identify");
if (noofpatches > 1)
appendpatch = "es";
else
appendpatch = "";
WriteStatus(String.Format(" {0} patch{1} applied.", noofpatches, appendpatch));
didpatch = true;
}
else else
WriteStatus(" - Could not patch ES_Identify"); WriteStatus(" - Could not patch ES_Identify");
break; break;
case "NAND permissions": case "NAND permissions":
if (iosp.PatchNandPermissions() > 0) noofpatches = iosp.PatchNandPermissions();
if (noofpatches > 0)
{
WriteStatus(" - Patched in NAND permissions"); WriteStatus(" - Patched in NAND permissions");
if (noofpatches > 1)
appendpatch = "es";
else
appendpatch = "";
WriteStatus(String.Format(" {0} patch{1} applied.", noofpatches, appendpatch));
didpatch = true;
}
else else
WriteStatus(" - Could not patch NAND permissions"); WriteStatus(" - Could not patch NAND permissions");
break; break;
@ -560,6 +591,22 @@ namespace NUS_Downloader
// WriteStatus(iosPatchesListBox.GetItemCheckState(iosPatchesListBox.Items.IndexOf(checkItem)).ToString()); // WriteStatus(iosPatchesListBox.GetItemCheckState(iosPatchesListBox.Items.IndexOf(checkItem)).ToString());
} }
} }
if (didpatch)
{
wadName = wadName.Replace(".wad",".patched.wad");
try
{
if (wadName.Contains(Path.DirectorySeparatorChar.ToString()) || wadName.Contains(Path.AltDirectorySeparatorChar.ToString()))
ioswad.Save(wadName);
else
ioswad.Save(Path.Combine(Path.Combine(Path.Combine(Path.Combine(CURRENT_DIR, "titles"), titleidbox.Text), nusClient.TitleVersion.ToString()), wadName));
WriteStatus(String.Format("Patched WAD saved as: {0}", Path.GetFileName(wadName)));
}
catch (Exception ex)
{
WriteStatus(String.Format("Couldn't save patched WAD: \"{0}\" :(",ex.Message));
}
}
} }
WriteStatus("NUS Download Finished."); WriteStatus("NUS Download Finished.");
@ -2247,6 +2294,9 @@ namespace NUS_Downloader
{ {
SetAllEnabled(true); SetAllEnabled(true);
iosPatchGroupBox.Visible = false; iosPatchGroupBox.Visible = false;
if (iosPatchesListBox.CheckedIndices.Count == 0)
// Uncheck the checkbox to indicate no patches
iosPatchCheckbox.Checked = false;
//packbox.Enabled = false; //packbox.Enabled = false;
} }
} }

View File

@ -431,6 +431,7 @@ namespace libWiiSharp
fireDebug(" Creating WAD..."); fireDebug(" Creating WAD...");
WAD wad = WAD.Create(cert, tik, tmd, contents); WAD wad = WAD.Create(cert, tik, tmd, contents);
wadName = wadName.Replace("[v]", this.TitleVersion.ToString());
if (wadName.Contains(Path.DirectorySeparatorChar.ToString()) || wadName.Contains(Path.AltDirectorySeparatorChar.ToString())) if (wadName.Contains(Path.DirectorySeparatorChar.ToString()) || wadName.Contains(Path.AltDirectorySeparatorChar.ToString()))
wad.Save(wadName); wad.Save(wadName);
else else

View File

@ -1,9 +1,9 @@
/////////////////////////////////////// ///////////////////////////////////////////
// NUS Downloader: Program.cs // // NUS Downloader: Program.cs //
// $Rev:: $ // // $Rev:: $ //
// $Author:: $ // // $Author:: $ //
// $Date:: $ // // $Date:: $ //
/////////////////////////////////////// ///////////////////////////////////////////
using System; using System;

View File

@ -1,15 +1,14 @@
/////////////////////////////////////// ///////////////////////////////////////////
// NUS Downlodaer: TODO // // NUS Downloader: TODO //
// $Rev:: $ // // $Rev:: $ //
// $Author:: $ // // $Author:: $ //
// $Date:: $ // // $Date:: $ //
/////////////////////////////////////// ///////////////////////////////////////////
Make more compatible with mono for Linux. Make more compatible with mono for Linux.
Broken stuff: Broken stuff:
- Downloading anything
- Bottom part of dialog cut off
Working stuff: Working stuff:
- Downloading anything
- Displaying Form1 - Displaying Form1
- Loading database - Loading database
- Generating update scripts - Generating update scripts

View File

@ -1,9 +1,9 @@
/////////////////////////////////////// ///////////////////////////////////////////
// NUS Downloader: WADPacker.cs // // NUS Downloader: WADPacker.cs //
// $Rev:: $ // // $Rev:: $ //
// $Author:: $ // // $Author:: $ //
// $Date:: $ // // $Date:: $ //
/////////////////////////////////////// ///////////////////////////////////////////
/////////////////////////////////////// ///////////////////////////////////////
// Copyright (C) 2010 // Copyright (C) 2010