From fd1a7231d04d7b0f3ee577c56ac76b4080f975b4 Mon Sep 17 00:00:00 2001 From: "gb.luke" Date: Sat, 19 Mar 2011 18:07:15 +0000 Subject: [PATCH] Add missing resources, fix SOAP update request --- NUS Downloader/Form1.cs | 64 ++- NUS Downloader/Form1.resx | 400 +++++++++--------- NUS Downloader/NUS Downloader.csproj | 4 +- .../Resources/bullet_redgreen-blue.png | Bin 0 -> 3218 bytes NUS Downloader/Resources/dsi16x16.png | Bin 0 -> 3288 bytes NUS Downloader/Resources/folder.png | Bin 0 -> 633 bytes NUS Downloader/Resources/money.png | Bin 0 -> 743 bytes NUS Downloader/Resources/wii16x16.png | Bin 0 -> 3495 bytes NUS Downloader/Resources/wrench.png | Bin 0 -> 617 bytes 9 files changed, 238 insertions(+), 230 deletions(-) create mode 100644 NUS Downloader/Resources/bullet_redgreen-blue.png create mode 100644 NUS Downloader/Resources/dsi16x16.png create mode 100644 NUS Downloader/Resources/folder.png create mode 100644 NUS Downloader/Resources/money.png create mode 100644 NUS Downloader/Resources/wii16x16.png create mode 100644 NUS Downloader/Resources/wrench.png diff --git a/NUS Downloader/Form1.cs b/NUS Downloader/Form1.cs index ba6f021..aaff811 100644 --- a/NUS Downloader/Form1.cs +++ b/NUS Downloader/Form1.cs @@ -1873,10 +1873,11 @@ namespace NUS_Downloader { System.Net.HttpWebRequest req = (System.Net.HttpWebRequest) - System.Net.HttpWebRequest.Create("http://nus.shop.wii.com:80/nus/services/NetUpdateSOAP"); + System.Net.HttpWebRequest.Create("http://nus.shop.wii.com/nus/services/NetUpdateSOAP"); + req.Method = "POST"; req.UserAgent = "wii libnup/1.0"; - req.Headers.Add("SOAPAction", '"' + "urn:nus.wsapi.broadon.com/" + '"'); + req.Headers.Add("SOAPAction", '"' + "urn:nus.wsapi.broadon.com/GetSystemUpdate" + '"'); // Proxy if (!(String.IsNullOrEmpty(proxy_url))) @@ -1904,19 +1905,20 @@ namespace NUS_Downloader req.UseDefaultCredentials = true; } - Stream writeStream = req.GetRequestStream(); - UTF8Encoding encoding = new UTF8Encoding(); byte[] bytes = encoding.GetBytes(soap_xml); + req.ContentType = "text/xml; charset=utf-8"; - //req.ContentLength = bytes.Length; + req.ContentLength = bytes.Length; + + Stream writeStream = req.GetRequestStream(); writeStream.Write(bytes, 0, bytes.Length); writeStream.Close(); Application.DoEvents(); try { string result; - System.Net.HttpWebResponse resp = (System.Net.HttpWebResponse) req.GetResponse(); + System.Net.HttpWebResponse resp = (System.Net.HttpWebResponse)req.GetResponse(); using (Stream responseStream = resp.GetResponseStream()) { @@ -1932,8 +1934,9 @@ namespace NUS_Downloader catch (Exception ex) { req.Abort(); - - return ex.Message.ToString(); + WriteStatus(" --- An Error Occurred: " + ex.Message.ToString()); + return null; // Ugh. + //return ex.Message.ToString(); } } @@ -1945,9 +1948,12 @@ namespace NUS_Downloader scriptsStrip.Close(); - string deviceID = "4362227770"; + /*string deviceID = "4362227774"; string messageID = "13198105123219138"; - string attr = "2"; + string attr = "2";*/ + string deviceID = "4362227770"; + string messageID = "13198105123219038"; + string attr = "1"; string RegionID = e.ClickedItem.Text.Substring(0, 3); if (RegionID == "JAP") // Japan fix, only region not w/ 1st 3 letters same as ID. @@ -1960,19 +1966,34 @@ namespace NUS_Downloader RegionID: EUR, Country: EU; RegionID: KOR, Country: KO; */ - string soap_req = "\n" + + "\n" + - "\n\n" + - "1.0\n" + messageID + "\n" + deviceID + - "\n" + - "" + RegionID + "\n" + CountryCode + - "\n\n0000000100000001\n" + - "2\n\n\n0000000100000002\n" + - "33\n\n\n0000000100000009\n" + - "516\n\n" + attr + - "\n\n" + - "\n\n"; + "\n" + + "\n" + + "1.0\n" + + "" + messageID + "\n" + + "" + deviceID + "\n" + + "" + RegionID + "\n" + + "" + CountryCode + "\n" + + "\n" + + "0000000100000001\n" + + "2\n"+ + "\n" + + "\n" + + "0000000100000002\n" + + "33\n"+ + "\n" + + "\n" + + "0000000100000009\n" + + "516\n" + + "\n" + + "" + attr + "\n" + + "\n" + + "\n" + + "\n" + + ""; WriteStatus(" - Sending SOAP Request to NUS..."); WriteStatus(" - Region: " + RegionID); @@ -2432,7 +2453,6 @@ namespace NUS_Downloader if (NUSDFileExists("dsikey.bin") == true) WriteStatus("DSi Decryption: Local (dsikey.bin)"); - if (NUSDFileExists("database.xml") == false) WriteStatus("Database (Wii): Need (database.xml)"); diff --git a/NUS Downloader/Form1.resx b/NUS Downloader/Form1.resx index df3e553..af6baad 100644 --- a/NUS Downloader/Form1.resx +++ b/NUS Downloader/Form1.resx @@ -1,4 +1,4 @@ - +