Small Changes. Images in the database display. Beta2 of v1.2

This commit is contained in:
givememystuffplease 2009-07-09 02:11:22 +00:00
parent c7fd7a29bf
commit e770c15458
10 changed files with 213 additions and 58 deletions

View File

@ -41,8 +41,6 @@
this.titleversion = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.button2 = new System.Windows.Forms.Button();
this.getcerts = new System.Windows.Forms.Button();
this.wadnamebox = new System.Windows.Forms.TextBox();
@ -96,6 +94,8 @@
this.label12 = new System.Windows.Forms.Label();
this.shamelessvariablelabel = new System.Windows.Forms.Label();
this.button3 = new System.Windows.Forms.Button();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.databaseStrip.SuspendLayout();
this.tmdgpbox.SuspendLayout();
this.ticketgpbox.SuspendLayout();
@ -210,30 +210,6 @@
this.label2.TabIndex = 11;
this.label2.Text = "Enter a Title ID Below:";
//
// radioButton2
//
this.radioButton2.Image = global::NUS_Downloader.Properties.Resources.dsi;
this.radioButton2.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
this.radioButton2.Location = new System.Drawing.Point(78, 385);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(74, 31);
this.radioButton2.TabIndex = 13;
this.radioButton2.UseVisualStyleBackColor = true;
this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged);
//
// radioButton1
//
this.radioButton1.BackColor = System.Drawing.Color.Transparent;
this.radioButton1.Checked = true;
this.radioButton1.Image = global::NUS_Downloader.Properties.Resources.wilolgoi;
this.radioButton1.Location = new System.Drawing.Point(12, 385);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(60, 31);
this.radioButton1.TabIndex = 12;
this.radioButton1.TabStop = true;
this.radioButton1.UseVisualStyleBackColor = false;
this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
//
// button2
//
this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
@ -309,7 +285,8 @@
this.toolStripSeparator1,
this.RegionCodesList});
this.databaseStrip.Name = "databaseStrip";
this.databaseStrip.Size = new System.Drawing.Size(155, 120);
this.databaseStrip.ShowItemToolTips = false;
this.databaseStrip.Size = new System.Drawing.Size(155, 142);
//
// SystemMenuList
//
@ -328,16 +305,16 @@
//
this.VCMenuList.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.C64MenuList,
this.GenesisMenuList,
this.MSXMenuList,
this.N64MenuList,
this.NeoGeoMenuList,
this.NESMenuList,
this.SNESMenuList,
this.N64MenuList,
this.MSXMenuList,
this.TurboGrafx16MenuList,
this.SegaMSMenuList,
this.GenesisMenuList,
this.VCArcadeMenuList,
this.TurboGrafxCDMenuList});
this.SNESMenuList,
this.TurboGrafx16MenuList,
this.TurboGrafxCDMenuList,
this.VCArcadeMenuList});
this.VCMenuList.Name = "VCMenuList";
this.VCMenuList.Size = new System.Drawing.Size(154, 22);
this.VCMenuList.Text = "Virtual Console";
@ -533,9 +510,9 @@
//
this.timelimitsecs.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.timelimitsecs.Location = new System.Drawing.Point(95, 99);
this.timelimitsecs.MaxLength = 200;
this.timelimitsecs.MaxLength = 10;
this.timelimitsecs.Name = "timelimitsecs";
this.timelimitsecs.Size = new System.Drawing.Size(62, 20);
this.timelimitsecs.Size = new System.Drawing.Size(148, 20);
this.timelimitsecs.TabIndex = 15;
this.timelimitsecs.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
@ -594,7 +571,7 @@
this.dlcamntbox.Location = new System.Drawing.Point(95, 19);
this.dlcamntbox.MaxLength = 6;
this.dlcamntbox.Name = "dlcamntbox";
this.dlcamntbox.Size = new System.Drawing.Size(62, 20);
this.dlcamntbox.Size = new System.Drawing.Size(148, 20);
this.dlcamntbox.TabIndex = 9;
this.dlcamntbox.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
//
@ -735,6 +712,30 @@
this.button3.UseVisualStyleBackColor = true;
this.button3.Click += new System.EventHandler(this.button3_Click_1);
//
// radioButton1
//
this.radioButton1.BackColor = System.Drawing.Color.Transparent;
this.radioButton1.Checked = true;
this.radioButton1.Image = global::NUS_Downloader.Properties.Resources.wilolgoi;
this.radioButton1.Location = new System.Drawing.Point(12, 385);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(60, 31);
this.radioButton1.TabIndex = 12;
this.radioButton1.TabStop = true;
this.radioButton1.UseVisualStyleBackColor = false;
this.radioButton1.CheckedChanged += new System.EventHandler(this.radioButton1_CheckedChanged);
//
// radioButton2
//
this.radioButton2.Image = global::NUS_Downloader.Properties.Resources.dsi;
this.radioButton2.ImageAlign = System.Drawing.ContentAlignment.TopCenter;
this.radioButton2.Location = new System.Drawing.Point(78, 385);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(74, 31);
this.radioButton2.TabIndex = 13;
this.radioButton2.UseVisualStyleBackColor = true;
this.radioButton2.CheckedChanged += new System.EventHandler(this.radioButton2_CheckedChanged);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View File

@ -4,6 +4,7 @@ using System.IO;
using System.Net;
using System.Security.Cryptography;
using System.Xml;
using System.Drawing;
namespace NUS_Downloader
{
@ -11,11 +12,19 @@ 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.2 Beta";
WebClient generalWC = new WebClient();
static RijndaelManaged rijndaelCipher;
static bool dsidecrypt = false;
// Images do not compare unless globalized...
Image green = Properties.Resources.bullet_green;
Image orange = Properties.Resources.bullet_orange;
Image redorb = Properties.Resources.bullet_red;
Image redgreen = Properties.Resources.bullet_redgreen;
Image redorange = Properties.Resources.bullet_redorange;
public struct WADHeader
{
public int HeaderSize;
@ -196,7 +205,7 @@ namespace NUS_Downloader
}
// Check for DSi common key bin file...
if (File.Exists(currentdir + "dskey.bin") == false)
if (File.Exists(currentdir + "dsikey.bin") == false)
{
// Do not pester about DSi key
}
@ -228,6 +237,7 @@ namespace NUS_Downloader
ClearDatabaseStrip();
FillDatabaseStrip();
LoadRegionCodes();
ShowInnerToolTips(false);
}
return result;
@ -544,6 +554,10 @@ namespace NUS_Downloader
WriteStatus("Please enter SOME info...");
return;
}
else
{
statusbox.Text = " --- " + titleidbox.Text + " ---";
}
// Running Downloads in background so no form freezing
NUSDownloader.RunWorkerAsync();
@ -662,7 +676,7 @@ namespace NUS_Downloader
// Standard/Korea
bool koreankey = false;
WriteStatus("0x01F1: " + Convert.ToString(cetkbuf[0x01F1]));
//WriteStatus("0x01F1: " + Convert.ToString(cetkbuf[0x01F1]));
if (cetkbuf[0x01F1] == 0x01)
{
WriteStatus("Key Type: Korean");
@ -683,7 +697,7 @@ namespace NUS_Downloader
keyBytes = LoadCommonKey(@"\key.bin");
}
else
keyBytes = LoadCommonKey(@"\dskey.bin");
keyBytes = LoadCommonKey(@"\dsikey.bin");
initCrypt(iv, keyBytes);
@ -704,6 +718,16 @@ namespace NUS_Downloader
}
titleversion.Text = Convert.ToString(int.Parse(tmdversion, System.Globalization.NumberStyles.HexNumber));
// Read System Version (Needed IOS)
string sysversion = "";
for (int i = 0; i < 8; i++)
{
sysversion += MakeProperLength(ConvertToHex(Convert.ToString(tmd[0x184 + i])));
}
sysversion = Convert.ToString(int.Parse(sysversion.Substring(14, 2), System.Globalization.NumberStyles.HexNumber));
if (sysversion != "0")
WriteStatus("Requires: IOS" + sysversion);
// Renaming would be ideal, but gives too many errors...
/*if ((currentdir + titleid + "v" + titleversion.Text + @"\") != titledirectory)
{
@ -1232,9 +1256,9 @@ namespace NUS_Downloader
WriteStatus("Wii Korea Decryption: OK");
}
if (File.Exists(currentdir + "dskey.bin") == false)
if (File.Exists(currentdir + "dsikey.bin") == false)
{
WriteStatus("DSi Decryption: Need (dskey.bin)");
WriteStatus("DSi Decryption: Need (dsikey.bin)");
}
else
{
@ -1255,7 +1279,9 @@ namespace NUS_Downloader
WriteStatus(" * Crediar for his wadmaker tool + source, and for the advice!");
WriteStatus(" * SquidMan/Galaxy/comex/Xuzz for advice/sources.");
WriteStatus(" * Pasta for database compilation assistance.");
WriteStatus(" * #WiiDev for general assistance whenever I had questions.");
WriteStatus(" * #WiiDev for answering the tough questions.");
WriteStatus(" * Anyone who helped beta test on GBATemp!");
WriteStatus(" * Famfamfam for the Silk Icon Set.");
}
private void getcerts_Click(object sender, EventArgs e)
@ -1557,7 +1583,9 @@ namespace NUS_Downloader
string titleID = "";
string descname = "";
string stticket = "";
bool dangerous = false;
bool ticket = true;
// Lol.
XmlNodeList ChildrenOfTheNode = XMLSpecificNodeTypeList[x].ChildNodes;
@ -1604,15 +1632,21 @@ namespace NUS_Downloader
default:
break;
case "ticket":
bool ticket = Convert.ToBoolean(ChildrenOfTheNode[z].InnerText);
if (!ticket)
ticket = Convert.ToBoolean(ChildrenOfTheNode[z].InnerText);
/*if (!ticket)
stticket += "(-)";
else
stticket += "(+)";
stticket += "(+)"; */
break;
case "danger":
dangerous = true;
string dangertext = ChildrenOfTheNode[z].InnerText;
XMLToolStripItem.ToolTipText = dangertext;
break;
}
XMLToolStripItem.Image = SelectItemImage(ticket, dangerous);
XMLToolStripItem.Text = titleID + " " + stticket + " " + descname;
XMLToolStripItem.Text = String.Format("{0} {1} {2}", titleID, stticket, descname);
XMLToolStripItem.Text = String.Format("{0} - {1}", titleID, descname);
}
AddToolStripItemToStrip(i, XMLToolStripItem, XMLAttributes);
}
@ -1626,10 +1660,10 @@ namespace NUS_Downloader
{
switch (attributes[0].Value)
{
case "Commodore 64":
case "C64":
C64MenuList.DropDownItems.Add(additionitem);
break;
case "NeoGeo":
case "NEO":
NeoGeoMenuList.DropDownItems.Add(additionitem);
break;
case "NES":
@ -1641,10 +1675,10 @@ namespace NUS_Downloader
case "N64":
N64MenuList.DropDownItems.Add(additionitem);
break;
case "TurboGrafx16":
case "TG16":
TurboGrafx16MenuList.DropDownItems.Add(additionitem);
break;
case "TurboGrafxCD":
case "TGCD":
TurboGrafxCDMenuList.DropDownItems.Add(additionitem);
break;
case "MSX":
@ -1653,10 +1687,10 @@ namespace NUS_Downloader
case "SMS":
SegaMSMenuList.DropDownItems.Add(additionitem);
break;
case "Genesis":
case "GEN":
GenesisMenuList.DropDownItems.Add(additionitem);
break;
case "VCArcade":
case "ARC":
VCArcadeMenuList.DropDownItems.Add(additionitem);
break;
default:
@ -1690,7 +1724,12 @@ namespace NUS_Downloader
titleidbox.Text = e.ClickedItem.OwnerItem.Text.Substring(0, 16);
titleversion.Text = "";
titleidbox.Text = titleidbox.Text.Replace("XX", e.ClickedItem.Text.Substring(0, 2));
if (e.ClickedItem.OwnerItem.Text.Contains("(-)"))
// Prepare StatusBox...
statusbox.Text = " --- " + e.ClickedItem.OwnerItem.Text.Substring(19, (e.ClickedItem.OwnerItem.Text.Length - 19)) + " ---";
// Check if a ticket is present...
if ((e.ClickedItem.OwnerItem.Image) == (orange) || (e.ClickedItem.OwnerItem.Image) == (redorange))
{
ignoreticket.Checked = true;
WriteStatus("Note: This title has no ticket and cannot be packed/decrypted!");
@ -1701,6 +1740,12 @@ namespace NUS_Downloader
{
ignoreticket.Checked = false;
}
// Check for danger item
if ((e.ClickedItem.OwnerItem.Image) == (redgreen) || (e.ClickedItem.OwnerItem.Image) == (redorange))
{
WriteStatus("\r\n" + e.ClickedItem.OwnerItem.ToolTipText);
}
}
void sysitem_versionclicked(object sender, ToolStripItemClickedEventArgs e)
@ -1725,7 +1770,11 @@ namespace NUS_Downloader
{
titleversion.Text = "";
}
if (e.ClickedItem.OwnerItem.Text.Contains("(-)"))
// Prepare StatusBox...
statusbox.Text = " --- " + e.ClickedItem.OwnerItem.Text.Substring(19, (e.ClickedItem.OwnerItem.Text.Length - 19)) + " ---";
if ((e.ClickedItem.OwnerItem.Image) == (orange) || (e.ClickedItem.OwnerItem.Image) == (redorange))
{
ignoreticket.Checked = true;
WriteStatus("Note: This title has no ticket and cannot be packed/decrypted!");
@ -1736,6 +1785,12 @@ namespace NUS_Downloader
{
ignoreticket.Checked = false;
}
// Check for danger item
if ((e.ClickedItem.OwnerItem.Image) == (redgreen) || (e.ClickedItem.OwnerItem.Image) == (redorange))
{
WriteStatus("\n" + e.ClickedItem.OwnerItem.ToolTipText);
}
}
void HandleMismatch(int contentsize, int actualsize)
@ -2085,12 +2140,56 @@ namespace NUS_Downloader
private void SetEnableforDownload(bool enabled)
{
// Disable things the user should not mess with during download...
downloadstartbtn.Enabled = enabled;
titleidbox.Enabled = enabled;
titleversion.Enabled = enabled;
TMDButton.Enabled = enabled;
databaseButton.Enabled = enabled;
packbox.Enabled = enabled;
localuse.Enabled = enabled;
ignoreticket.Enabled = enabled;
truchabox.Enabled = enabled;
decryptbox.Enabled = enabled;
}
private void ShowInnerToolTips(bool enabled)
{
// Force tooltips to GTFO in sub menus...
foreach (ToolStripItem item in databaseStrip.Items)
{
try
{
ToolStripMenuItem menuitem = (ToolStripMenuItem)item;
menuitem.DropDown.ShowItemToolTips = false;
}
catch (Exception)
{
// Do nothing, some objects will not cast.
}
}
}
private System.Drawing.Image SelectItemImage(bool ticket, bool danger)
{
// All is good, go green...
if ((ticket) && (!danger))
return green;
// There's no ticket, but danger is clear...
if ((!ticket) && (!danger))
return orange;
// DANGER WILL ROBINSON...
if ((ticket) && (danger))
return redgreen;
// Double bad...
if ((!ticket) && (danger))
return redorange;
return null;
}
}
}

View File

@ -30,7 +30,7 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>5</ApplicationRevision>
<ApplicationRevision>6</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
@ -102,6 +102,11 @@
</ItemGroup>
<ItemGroup>
<Content Include="direction_down.ico" />
<None Include="Resources\bullet_redgreen.png" />
<None Include="Resources\bullet_green.png" />
<None Include="Resources\bullet_redorange.png" />
<None Include="Resources\bullet_orange.png" />
<None Include="Resources\bullet_red.png" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">

View File

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3506
// Runtime Version:2.0.50727.4918
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@ -60,6 +60,41 @@ namespace NUS_Downloader.Properties {
}
}
internal static System.Drawing.Bitmap bullet_green {
get {
object obj = ResourceManager.GetObject("bullet_green", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap bullet_orange {
get {
object obj = ResourceManager.GetObject("bullet_orange", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap bullet_red {
get {
object obj = ResourceManager.GetObject("bullet_red", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap bullet_redgreen {
get {
object obj = ResourceManager.GetObject("bullet_redgreen", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap bullet_redorange {
get {
object obj = ResourceManager.GetObject("bullet_redorange", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap dsi {
get {
object obj = ResourceManager.GetObject("dsi", resourceCulture);

View File

@ -124,4 +124,19 @@
<data name="dsi" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\dsi.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="bullet_red" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\bullet_red.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="bullet_green" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\bullet_green.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="bullet_orange" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\bullet_orange.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="bullet_redorange" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\bullet_redorange.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="bullet_redgreen" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\bullet_redgreen.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB