From 3f5082ba9c74d614df6586d30e479a0096ac1150 Mon Sep 17 00:00:00 2001 From: givememystuffplease Date: Sat, 13 Jun 2009 16:04:54 +0000 Subject: [PATCH] Korean Key (Ticket) Support --- NUS Downloader/Form1.cs | 71 ++++++++++++++---- NUS Downloader/NUS Downloader.csproj | 1 - .../NUS Downloader_TemporaryKey.pfx | Bin 1700 -> 0 bytes 3 files changed, 58 insertions(+), 14 deletions(-) delete mode 100644 NUS Downloader/NUS Downloader_TemporaryKey.pfx diff --git a/NUS Downloader/Form1.cs b/NUS Downloader/Form1.cs index 3981e8f..bddd056 100644 --- a/NUS Downloader/Form1.cs +++ b/NUS Downloader/Form1.cs @@ -170,6 +170,17 @@ namespace NUS_Downloader WriteStatus("Common Key detected."); } + // Check for Wii KOR common key bin file... + if (File.Exists(currentdir + "kkey.bin") == false) + { + //WriteStatus("Korean Common Key (kkey.bin) missing! Decryption disabled!"); + //decryptbox.Visible = false; + } + else + { + WriteStatus("Korean Common Key detected."); + } + // Check for DSi common key bin file... if (File.Exists(currentdir + "dskey.bin") == false) { @@ -640,10 +651,28 @@ namespace NUS_Downloader iv[i+8] = 0x00; } + // Standard/Korea + bool koreankey = false; + WriteStatus("0x01F1: " + Convert.ToString(cetkbuf[0x01F1])); + if (cetkbuf[0x01F1] == 0x01) + { + WriteStatus("Key Type: Korean"); + koreankey = true; + } + else + { + WriteStatus("Key Type: Standard"); + } + // Common Key byte[] keyBytes; if (wiimode) - keyBytes = LoadCommonKey(@"\key.bin"); + { + if (koreankey) + keyBytes = LoadCommonKey(@"\kkey.bin"); + else + keyBytes = LoadCommonKey(@"\key.bin"); + } else keyBytes = LoadCommonKey(@"\dskey.bin"); @@ -779,7 +808,7 @@ namespace NUS_Downloader { WriteStatus(" - Hash Check: Fail"); WriteStatus(" - True Hash: " + DisplayBytes(hash)); - WriteStatus(" - You Got: " + DisplayBytes(ComputeSHA(Decrypt(contbuf)))); + WriteStatus(" - You Have: " + DisplayBytes(ComputeSHA(Decrypt(contbuf)))); } } @@ -1084,6 +1113,15 @@ namespace NUS_Downloader WriteStatus("Wii Decryption: OK"); } + if (File.Exists(currentdir + "kkey.bin") == false) + { + WriteStatus("Wii Korea Decryption: Need (kkey.bin)"); + } + else + { + WriteStatus("Wii Korea Decryption: OK"); + } + if (File.Exists(currentdir + "dskey.bin") == false) { WriteStatus("DSi Decryption: Need (dskey.bin)"); @@ -1092,11 +1130,21 @@ namespace NUS_Downloader { WriteStatus("DSi Decryption: OK"); } + + if (File.Exists(currentdir + "database.xml") == false) + { + WriteStatus("Database: Need (database.xml)"); + } + else + { + WriteStatus("Database: OK"); + } WriteStatus(""); WriteStatus("Special thanks to:"); WriteStatus(" * Crediar for his wadmaker tool + source, and for the advice!"); WriteStatus(" * SquidMan/Galaxy/comex for advice/sources."); + WriteStatus(" * Pasta for database compilation assistance."); WriteStatus(" * #WiiDev for general assistance whenever I had questions."); } @@ -1251,18 +1299,15 @@ namespace NUS_Downloader private void titleversion_TextChanged(object sender, EventArgs e) { // Change WAD name if applicable - if (packbox.Checked == true) + if ((titleidbox.Enabled == true) && (packbox.Checked == true)) { - if (titleidbox.Enabled == true) + if (titleversion.Text != "") { - if (titleversion.Text != "") - { - wadnamebox.Text = titleidbox.Text + "-NUS-v" + titleversion.Text + ".wad"; - } - else - { - wadnamebox.Text = titleidbox.Text + "-NUS-[v]" + titleversion.Text + ".wad"; - } + wadnamebox.Text = titleidbox.Text + "-NUS-v" + titleversion.Text + ".wad"; + } + else + { + wadnamebox.Text = titleidbox.Text + "-NUS-[v]" + titleversion.Text + ".wad"; } } } @@ -1602,7 +1647,7 @@ namespace NUS_Downloader { /* Typical Region XML * - 41 (All/System) + 41 (All/System) 44 (German) 45 (USA/NTSC) 46 (French) diff --git a/NUS Downloader/NUS Downloader.csproj b/NUS Downloader/NUS Downloader.csproj index 7731d4c..cb98d2c 100644 --- a/NUS Downloader/NUS Downloader.csproj +++ b/NUS Downloader/NUS Downloader.csproj @@ -97,7 +97,6 @@ - diff --git a/NUS Downloader/NUS Downloader_TemporaryKey.pfx b/NUS Downloader/NUS Downloader_TemporaryKey.pfx deleted file mode 100644 index 2b95d325593cf4a00729dc9eab622c95958bd02b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1700 zcmY+Ddpy+n8ppqLF=Iw|hY0b;-CCHSAl79zVa>3Wk)>tpv9yx>}iEtct+`) zn~VGC(f^cMCM@_kdUn!Xw~XBDY*xhXdEqtbX0JRp+ka{GEO}zWH!10Jf>MaG$~wE+ zyzuzAN}Bvgq~7cIjsbGkoeR)j;a5tdp1hQxdgb3t6Z?huw;k8w&n^FkRR}hz8~W=A z^g`X5hOhhfP+q2rbvX-L9~#Mw1}&y;Rq2FIb2Kx(I0UJ}zpyv%6vwXNl8R1?*R$A! z%$&_$xU-T_%3gzvq4BrFbJ$1sJCC`Ht`t5EEUfGe~b4SNVlBR59dP`(U8Ltgg{voe^DJ5#QGOY|a zy?Si?eV!k6hrFjTbx)KA*{BS!MYdQo++}<8E>eB9z-X$S_O2_N+#Gk+z*7E3dqs~H z)vIE2{`cH+9!HjfdECA_^J<$I-4?5%xw9eTKkB2a!4GP(HRJ&?<6GlPa!&=UjQ(hU zP;>Zu-ay?YpKUun`TcYzZA!f@qDMrIG1y5ea2Yk%O+LsV2s-38b=VH#9=EVW#hvY^ z-N>~eZOdbQSAKCkUP0cdq^v1 zG$AM^N;H}OvfC1nuO`g6^3n<*GH8UX-+0{(&o3QOM&B!UBg0-V5p00C=Y1!!Ow ztSE5MVPypz;hPGp{cs-@FkwZ9DHHC6fGx0u`)z2C90NSq ziRpj-9*cp^nE<1BBm%(KiN7j{zu6V@#jbkcnmYb0liV+MO%@^@?$H*}L^bMofwq2O z)UHhosb%SU72zDiW=V1F#j{p|c*)43`Y7~bVTOBnLZJHU`I%-}%aQ&LGr!FfcT=Qc zi+G!#xEuVS5r>jH@jnjG!u?#WHG(nRLAEh=_EC7s36HXDv%Moh`Kc$AlTE(I)p_{5 z9IV(HL=)s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