Added new fixes to my build changes. hopefully...

This commit is contained in:
givememystuffplease 2009-10-15 22:23:08 +00:00
parent 44920dc610
commit 1e76a7bfea
4 changed files with 91 additions and 63 deletions

View File

@ -314,7 +314,6 @@
this.databaseStrip.Name = "databaseStrip";
this.databaseStrip.ShowItemToolTips = false;
this.databaseStrip.Size = new System.Drawing.Size(164, 170);
//this.databaseStrip.Opening += new System.ComponentModel.CancelEventHandler(this.databaseStrip_Opening);
//
// SystemMenuList
//
@ -760,9 +759,9 @@
this.contentModBox.Controls.Add(this.button11);
this.contentModBox.Controls.Add(this.button9);
this.contentModBox.Controls.Add(this.button10);
this.contentModBox.Location = new System.Drawing.Point(278, 434);
this.contentModBox.Location = new System.Drawing.Point(265, 146);
this.contentModBox.Name = "contentModBox";
this.contentModBox.Size = new System.Drawing.Size(249, 69);
this.contentModBox.Size = new System.Drawing.Size(249, 329);
this.contentModBox.TabIndex = 41;
this.contentModBox.TabStop = false;
this.contentModBox.Text = "Edit Title Contents";
@ -1172,7 +1171,6 @@
this.Controls.Add(this.saveaswadbox);
this.Controls.Add(this.databaseButton);
this.Controls.Add(this.button5);
this.Controls.Add(this.contentModBox);
this.Controls.Add(this.proxyBox);
this.Controls.Add(this.button4);
this.Controls.Add(this.wadnamebox);
@ -1185,6 +1183,7 @@
this.Controls.Add(this.button7);
this.Controls.Add(this.radioButton1);
this.Controls.Add(this.radioButton2);
this.Controls.Add(this.contentModBox);
this.Controls.Add(this.packbox);
this.Controls.Add(this.statusbox);
this.Controls.Add(this.ignoreticket);

View File

@ -19,7 +19,7 @@ namespace NUS_Downloader
const string NUSURL = "http://nus.cdn.shop.wii.com/ccs/download/";
const string DSiNUSURL = "http://nus.cdn.t.shop.nintendowifi.net/ccs/download/";
// TODO: Always remember to change version!
string version = "v1.4 Beta";
string version = "v1.3 Beta";
WebClient generalWC = new WebClient();
static RijndaelManaged rijndaelCipher;
static bool dsidecrypt = false;
@ -206,6 +206,7 @@ namespace NUS_Downloader
{
// Directory stuff
string currentdir = Application.StartupPath;
if (currentdir.EndsWith(Convert.ToString(Path.DirectorySeparatorChar.ToString())) == false)
currentdir += Path.DirectorySeparatorChar.ToString();
@ -771,6 +772,7 @@ namespace NUS_Downloader
// Current directory...
string currentdir = Application.StartupPath;
if (!(currentdir.EndsWith(Path.DirectorySeparatorChar.ToString())) || !(currentdir.EndsWith(Path.AltDirectorySeparatorChar.ToString())))
currentdir += Path.DirectorySeparatorChar.ToString();
@ -852,6 +854,7 @@ namespace NUS_Downloader
dlprogress.Value = 50;
// Download CETK after tmd...
bool ticket_exists = true;
try
{
DownloadNUSFile(titleid, "cetk", titledirectory, 0, wiimode);
@ -874,16 +877,21 @@ namespace NUS_Downloader
WriteStatus("Ticket not found! Continuing, however WAD packing and decryption are not possible!");
packbox.Checked = false;
decryptbox.Checked = false;
ticket_exists = false;
}
}
downloadstartbtn.Text = "Prerequisites: (2/2)";
dlprogress.Value = 100;
byte[] cetkbuf = new byte[0];
byte[] titlekey = new byte[0];
if (ticket_exists)
{
// Create ticket file holder
byte[] cetkbuf = FileLocationToByteArray(titledirectory + Path.DirectorySeparatorChar.ToString() + @"cetk");
cetkbuf = FileLocationToByteArray(titledirectory + Path.DirectorySeparatorChar.ToString() + @"cetk");
// Obtain TitleKey
byte[] titlekey = new byte[16];
titlekey = new byte[16];
if (decryptbox.Checked == true)
{
// Load TitleKey into it's byte[]
@ -901,7 +909,7 @@ namespace NUS_Downloader
}
for (int i = 0; i < 8; i++)
{
iv[i+8] = 0x00;
iv[i + 8] = 0x00;
}
// Standard/Korea Common Key
@ -925,10 +933,13 @@ namespace NUS_Downloader
WriteStatus("Title Key: " + DisplayBytes(Decrypt(titlekey), ""));
titlekey = Decrypt(titlekey);
}
}
// Read the tmd as a stream...
byte[] tmd = FileLocationToByteArray(titledirectory + tmdfull);
if (ticket_exists == true)
{
// Locate Certs **************************************
if (!(CertsValid()))
{
@ -939,6 +950,7 @@ namespace NUS_Downloader
else
WriteStatus("Using cached certs...");
// /Locate Cert **************************************
}
// Read Title Version...
string tmdversion = "";
@ -953,12 +965,11 @@ namespace NUS_Downloader
if (sysversion != "0")
WriteStatus("Requires: IOS" + sysversion);
// Renaming would be ideal, but gives too many errors...
// Renaming would be ideal, but gives too many permission errors...
/*if ((currentdir + titleid + "v" + titleversion.Text + Path.DirectorySeparatorChar.ToString()) != titledirectory)
{
Directory.Move(titledirectory, currentdir + titleid + "v" + titleversion.Text + Path.DirectorySeparatorChar.ToString());
titledirectory = currentdir + titleid + "v" + titleversion.Text + Path.DirectorySeparatorChar.ToString();
DirectoryInfo di = new DirectoryInfo(titledirectory);
} */
// Read Content #...
@ -3435,7 +3446,7 @@ namespace NUS_Downloader
wiibrewsource = wiibrewsource.Replace("&lt;","<");
wiibrewsource = wiibrewsource.Replace("&gt;",">");
wiibrewsource = wiibrewsource.Replace("&quot;",'"'.ToString());
wiibrewsource = wiibrewsource.Replace("&nbsp;", " "); // Shouldn't occur, but they happen...
wiibrewsource = wiibrewsource.Replace("&nbsp;"," "); // Shouldn't occur, but they happen...
// Return parsed xml database...
return wiibrewsource;
@ -3467,6 +3478,12 @@ namespace NUS_Downloader
File.Delete("database.xml");
File.WriteAllText("database.xml", database);
// Load it up...
ClearDatabaseStrip();
FillDatabaseStrip();
LoadRegionCodes();
ShowInnerToolTips(false);
WriteStatus("Database successfully updated!");
}
@ -3637,7 +3654,7 @@ namespace NUS_Downloader
if (!(Directory.Exists(currentdir + "scripts")))
{
Directory.CreateDirectory(currentdir + "scripts");
WriteStatus(" - Created 'scrips\' directory.");
WriteStatus(" - Created 'scripts\' directory.");
}
string time = RemoveIllegalCharacters(DateTime.Now.ToShortTimeString());
File.WriteAllText(String.Format(currentdir + "scripts\\{0}_Update_{1}_{2}_{3} {4}.nus", RegionID, DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Year, time), script_text);

View File

@ -30,7 +30,7 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>10</ApplicationRevision>
<ApplicationRevision>11</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>

View File

@ -6,6 +6,18 @@ namespace NUS_Downloader
{
class TMD
{
// TMD Variables
public byte[] SignatureType;
/* Signature Types
public enum SigTypes : byte[]
{
RSA_2048 = new byte[4] {0x00, 0x01, 0x00, 0x01},
RSA_4048 = new byte[4] {0x00, 0x01, 0x00, 0x01}
} */
/*
* Title metadata is a format used to store information about a title (a single standalone game, channel, etc.) and all its installed contents, including which contents they consist of and their SHA1 hashes.