Fixed Trucha Version/DLC Amount readout bug. This is post v1.2 Beta.

This commit is contained in:
givememystuffplease 2009-07-07 23:41:38 +00:00
parent 3a7bcb90b0
commit c7fd7a29bf
2 changed files with 25 additions and 24 deletions

View File

@ -11,7 +11,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/";
string version = "v1.2";
string version = "v1.2 Beta";
WebClient generalWC = new WebClient();
static RijndaelManaged rijndaelCipher;
static bool dsidecrypt = false;
@ -554,9 +554,7 @@ namespace NUS_Downloader
// Preparations for Downloading
Control.CheckForIllegalCrossThreadCalls = false;
WriteStatus("Starting NUS Download. Please be patient!");
downloadstartbtn.Enabled = false;
titleidbox.Enabled = false;
titleversion.Enabled = false;
SetEnableforDownload(false);
downloadstartbtn.Text = "Starting NUS Download!";
// Current directory...
@ -598,9 +596,7 @@ namespace NUS_Downloader
WriteStatus("Download Failed: " + tmdfull);
WriteStatus(" - Reason: " + ex.Message.ToString().Replace("The remote server returned an error: ", ""));
downloadstartbtn.Enabled = true;
titleidbox.Enabled = true;
titleversion.Enabled = true;
SetEnableforDownload(true);
downloadstartbtn.Text = "Start NUS Download!";
dlprogress.Value = 0;
DeleteTitleDirectory();
@ -621,8 +617,7 @@ namespace NUS_Downloader
WriteStatus("Download Failed: cetk");
WriteStatus(" - Reason: " + ex.Message.ToString().Replace("The remote server returned an error: ", ""));
WriteStatus("You may be able to retrieve the contents by Ignoring the Ticket (Check below)");
titleidbox.Enabled = true;
titleversion.Enabled = true;
SetEnableforDownload(true);
downloadstartbtn.Text = "Start NUS Download!";
dlprogress.Value = 0;
DeleteTitleDirectory();
@ -760,9 +755,7 @@ namespace NUS_Downloader
{
WriteStatus("Download Failed: " + tmdcontents[i]);
WriteStatus(" - Reason: " + ex.Message.ToString().Replace("The remote server returned an error: ", ""));
downloadstartbtn.Enabled = true;
titleidbox.Enabled = true;
titleversion.Enabled = true;
SetEnableforDownload(true);
downloadstartbtn.Text = "Start NUS Download!";
dlprogress.Value = 0;
DeleteTitleDirectory();
@ -837,7 +830,7 @@ namespace NUS_Downloader
{
// Read information from TMD into signing GUI...
requiredIOSbox.Text = Convert.ToString(tmd[0x18B]);
tmdversiontrucha.Text = TrimLeadingZeros(Convert.ToString(tmd[0x1DC]) + Convert.ToString(tmd[0x1DD]));
tmdversiontrucha.Text = Convert.ToString((tmd[0x1DC]*256) + tmd[0x1DD]);
newtitleidbox.Text = titleid;
// Setup for NO IOS
@ -873,7 +866,7 @@ namespace NUS_Downloader
titleIDIV.Text = DisplayBytes(iv).Replace(" ", "");
//DLC
dlcamntbox.Text = TrimLeadingZeros(Convert.ToString(cetkbuff[0x1E6]) + Convert.ToString(cetkbuff[0x1E7]));
dlcamntbox.Text = Convert.ToString((cetkbuff[0x1E6]*256) + cetkbuff[0x1E7]);
//keyindex
if (cetkbuff[0x1F1] == 0x00)
@ -905,7 +898,7 @@ namespace NUS_Downloader
shamelessvariablelabel.Text = String.Format("{0},{1},{2}", titledirectory, tmdfull, contentstrnum);
// Loop until finished...
// Loop until user is finished...
while (this.Size == this.MaximumSize)
{
System.Threading.Thread.Sleep(1000);
@ -950,9 +943,7 @@ namespace NUS_Downloader
PackWAD(titleid, tmdfull, tmdcontents.Length, tmdcontents, tmdsizes, titledirectory);
}
downloadstartbtn.Enabled = true;
titleidbox.Enabled = true;
titleversion.Enabled = true;
SetEnableforDownload(true);
downloadstartbtn.Text = "Start NUS Download!";
dlprogress.Value = 0;
@ -1894,7 +1885,8 @@ namespace NUS_Downloader
// Read information from TMD into signing GUI...
requiredIOSbox.Text = Convert.ToString(tmd[0x18B]);
tmdversiontrucha.Text = TrimLeadingZeros(Convert.ToString(tmd[0x1DC]) + Convert.ToString(tmd[0x1DD]));
// Lulzy cheap way of getting version... *256
tmdversiontrucha.Text = Convert.ToString(((tmd[0x1DC]*256) + tmd[0x1DD]));
newtitleidbox.Text = titleidbox.Text;
// Setup for NO IOS
@ -1938,7 +1930,7 @@ namespace NUS_Downloader
titleIDIV.Text = DisplayBytes(iv).Replace(" ", "");
//DLC
dlcamntbox.Text = TrimLeadingZeros(Convert.ToString(cetkbuff[0x1E6]) + Convert.ToString(cetkbuff[0x1E7]));
dlcamntbox.Text = Convert.ToString((cetkbuff[0x1E6]*256) + cetkbuff[0x1E7]);
//keyindex
if (cetkbuff[0x1F1] == 0x00)
@ -2091,5 +2083,14 @@ namespace NUS_Downloader
statusbox.Text = "";
}
private void SetEnableforDownload(bool enabled)
{
downloadstartbtn.Enabled = enabled;
titleidbox.Enabled = enabled;
titleversion.Enabled = enabled;
TMDButton.Enabled = enabled;
databaseButton.Enabled = enabled;
}
}
}

View File

@ -16,8 +16,10 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<ManifestCertificateThumbprint>5828AACDBD1A48E3768B7E0465E90D0E96E2BE4C</ManifestCertificateThumbprint>
<ManifestKeyFile>NUS Downloader_TemporaryKey.pfx</ManifestKeyFile>
<GenerateManifests>false</GenerateManifests>
<GenerateManifests>true</GenerateManifests>
<SignManifests>true</SignManifests>
<TargetZone>LocalIntranet</TargetZone>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
@ -28,12 +30,10 @@
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>4</ApplicationRevision>
<ApplicationRevision>5</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetZone>LocalIntranet</TargetZone>
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>