Exemple #1
0
        private bool IsValidEncryptedBase(string path)
        {
            string titleId = NusContent.CheckEncrypted(path);

            if (titleId != null &&
                NusContent.CheckCommonKeyFiles() &&
                File.Exists("resources\\jnustool\\JNUSTool.jar"))
            {
                string name = NusContent.JNUSToolWrapper(path, 400, 32768, titleId, "/code/cos.xml");

                if (name != null && File.Exists(name + "\\code\\cos.xml"))
                {
                    XmlDocument xmlCos = new XmlDocument();
                    xmlCos.Load(name + "\\code\\cos.xml");
                    XmlNode cos_argstr = xmlCos.SelectSingleNode("app/argstr");

                    Directory.Delete(name, true);

                    if (cos_argstr.InnerText == "hachihachi_ntr.rpx")
                    {
                        return(true);
                    }
                    else
                    {
                        Cll.Log.WriteLine("\"" + path + "\" does not contain a NDS Wii U VC game.");
                        return(false);
                    }
                }
                else if (name != null)
                {
                    Cll.Log.WriteLine("The NUS CONTENT does not contains \"cos.xml\" file.");
                    Directory.Delete(name, true);
                    return(false);
                }
                else
                {
                    Cll.Log.WriteLine("JNUSToolWrapper could not decipher the NUS CONTENT.");
                    return(false);
                }
            }
            else
            {
                Cll.Log.WriteLine("Some of the following files are missing:");
                Cll.Log.WriteLine(path + "\\title.tmd");
                Cll.Log.WriteLine(path + "\\title.tik");
                Cll.Log.WriteLine(path + "\\title.cert");
                return(false);
            }
        }