private bool AskBase() { folderBrowserDialog.Description = "Select the folder of the NDS VC game you want to use as a base."; if (Directory.Exists(textBoxBaseFrom.Text)) { folderBrowserDialog.SelectedPath = textBoxBaseFrom.Text; } else { folderBrowserDialog.SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop); } if (folderBrowserDialog.ShowDialog() == DialogResult.OK) { labelLoadedBase.Text = "Base: Wait..."; panelLoadedBase.BackgroundImage = global::DSInject.Properties.Resources.x_mark_16; this.Update(); textBoxBaseFrom.Text = folderBrowserDialog.SelectedPath; Cll.Log.WriteLine("Loading base."); if (injector.LoadBase(textBoxBaseFrom.Text)) { labelLoadedBase.Text = "Base: " + injector.LoadedBase; panelLoadedBase.BackgroundImage = global::DSInject.Properties.Resources.checkmark_16; return(true); } else { labelLoadedBase.Text = "The base is not valid."; panelLoadedBase.BackgroundImage = global::DSInject.Properties.Resources.x_mark_16; } } return(false); }
public void Run(string[] args) { Cll.Log.WriteLine("DSInject " + DSInjector.Release + " - by phacox.cll"); Cll.Log.WriteLine(""); if (NusContent.GetJavaVersion() == null) { Cll.Log.WriteLine("Warning! Apparently the system does not have Java installed!"); Cll.Log.WriteLine("Java is needed to NUSPacker (encrypt) and JNUSTool (decrypt)."); Cll.Log.WriteLine(""); } else { if (!File.Exists("resources\\nuspacker\\NUSPacker.jar")) { Cll.Log.WriteLine("Warning! \"resources\\nuspacker\\NUSPacker.jar\" not found!"); Cll.Log.WriteLine("NUSPacker allows you to encrypt the result for WUPInstaller."); Cll.Log.WriteLine(""); } if (!File.Exists("resources\\jnustool\\JNUSTool.jar")) { Cll.Log.WriteLine("Warning! \"resources\\jnustool\\JNUSTool.jar\" not found!"); Cll.Log.WriteLine("JNUSTool allows you to decrypt Wii U VC games to use as a base."); Cll.Log.WriteLine(""); } } if (NusContent.CheckCommonKeyFiles()) { Cll.Log.WriteLine("Common Key found successfully."); } else { Cll.Log.WriteLine("Common Key not found. Use load-key option."); } if (injector.BaseIsLoaded) { Cll.Log.WriteLine("Base loaded: " + injector.LoadedBase); } else { Cll.Log.WriteLine("Base not found. Use load-base option or specify one using the -base option."); } Cll.Log.WriteLine(""); if (args.Length == 0) { ConsoleHelp(); } else if (args.Length == 1 && args[0] == "help") { ConsoleHelp(); } else if (args.Length == 2 && args[0] == "load-key") { Cll.Log.WriteLine("load-key: " + args[1]); if (NusContent.LoadKey(args[1])) { Cll.Log.WriteLine("Common Key loaded successfully."); } else { Cll.Log.WriteLine("The load of the key failed. Is a valid Common Key?"); } } else if (args.Length == 2 && args[0] == "load-base") { Cll.Log.WriteLine("load-base: " + args[1]); Cll.Log.WriteLine("Loading base, please wait..."); if (injector.LoadBase(args[1])) { Cll.Log.WriteLine("Base loaded: " + injector.LoadedBase); } else { Cll.Log.WriteLine("The base was not loaded correctly."); } } else if (args.Length >= 1 && args[0] == "create-image") { if (CreateImage(args)) { Cll.Log.WriteLine("Image created."); } else { Cll.Log.WriteLine("Image not created."); } } else if (args.Length >= 1 && args[0] == "create-icon") { if (CreateIcon(args)) { Cll.Log.WriteLine("Icon created."); } else { Cll.Log.WriteLine("Icon not created."); } } else if ((args.Length == 3 || args.Length == 5) && (args[0] == "pack" || args[0] == "unpack")) { PackUnpack(args); } else { bool _continue = LoadArgs(args); if (_continue) { _continue = ValidArgs(); } if (_continue) { Inject(); } } Cll.Log.WriteLine("Close."); Cll.Log.WriteLine("----------------------------------------------------------------"); }