private bool Inject() { Cll.Log.WriteLine("Injecting - - - - - - - - - - - - - - - - - - - - - - - - - - - "); if (injector.BasePath != null) { Cll.Log.WriteLine("base: " + injector.BasePath); } if (injector.ShortName != null) { Cll.Log.WriteLine("name: " + injector.ShortName); } if (injector.LongName != null) { Cll.Log.WriteLine("longname:\n" + injector.LongName); } if (injector.InPath != null) { Cll.Log.WriteLine("in: " + injector.InPath); } if (injector.RomPath != null) { Cll.Log.WriteLine("rom: " + injector.RomPath); } if (injector.BootTvPath != null) { Cll.Log.WriteLine("tv: " + injector.BootTvPath); } if (injector.BootDrcPath != null) { Cll.Log.WriteLine("drc: " + injector.BootDrcPath); } if (injector.IconPath != null) { Cll.Log.WriteLine("icon: " + injector.IconPath); } if (injector.OutPath != null) { Cll.Log.WriteLine("out: " + injector.OutPath); } Cll.Log.WriteLine("encrypt: " + injector.Encrypt.ToString()); Cll.Log.WriteLine("Please wait..."); return(injector.Inject()); }
private void buttonInject_Click(object sender, EventArgs e) { bool _continue = true; if (textBoxShortName.Text.Length != 0) { injector.ShortName = textBoxShortName.Text; } else { _continue = false; MessageBox.Show("The name of the game is empty.", "Short name", MessageBoxButtons.OK, MessageBoxIcon.Error); } if (_continue) { if (checkBoxLongName.Checked) { if (textBoxLNLine1.Text.Length != 0 && textBoxLNLine2.Text.Length != 0) { injector.LongName = textBoxLNLine1.Text + "\n" + textBoxLNLine2.Text; } else { _continue = false; MessageBox.Show("The long name of the game is empty.", "Long name", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { injector.LongName = injector.ShortName; } } if (_continue && checkBoxAskBase.Checked) { _continue = AskBase(); if (_continue) { labelTitleId.Text = "Title ID: " + injector.TitleId; this.Update(); } else { labelTitleId.Text = "Title ID:"; MessageBox.Show("The base was not loaded correctly.", "DSInject", MessageBoxButtons.OK, MessageBoxIcon.Error); } } folderBrowserDialog.Description = "Select the folder where the result will be saved."; folderBrowserDialog.SelectedPath = ResultDir; if (_continue && folderBrowserDialog.ShowDialog() == DialogResult.OK) { injector.Encrypt = checkBoxPackUpResult.Checked; injector.OutPath = folderBrowserDialog.SelectedPath + "\\" + injector.ShortNameASCII + " [" + injector.TitleId + "]"; ResultDir = folderBrowserDialog.SelectedPath; if (Directory.Exists(injector.OutPath)) { if (Directory.GetDirectories(injector.OutPath).Length != 0 || Directory.GetFiles(injector.OutPath).Length != 0) { _continue = false; MessageBox.Show("The \"" + injector.OutPath + "\" folder exist and not empty.", "DSInject", MessageBoxButtons.OK, MessageBoxIcon.Error); } } if (_continue) { Cll.Log.WriteLine("Injecting - - - - - - - - - - - - - - - - - - - - - - - - - - - "); if (injector.BasePath != null) { Cll.Log.WriteLine("base: " + injector.BasePath); } if (injector.ShortName != null) { Cll.Log.WriteLine("name: " + injector.ShortName); } if (injector.LongName != null) { Cll.Log.WriteLine("longname:\n" + injector.LongName); } if (injector.InPath != null) { Cll.Log.WriteLine("in: " + injector.InPath); } if (injector.RomPath != null) { Cll.Log.WriteLine("rom: " + injector.RomPath); } if (injector.BootTvPath != null) { Cll.Log.WriteLine("tv: " + injector.BootTvPath); } if (injector.BootDrcPath != null) { Cll.Log.WriteLine("drc: " + injector.BootDrcPath); } if (injector.IconPath != null) { Cll.Log.WriteLine("icon: " + injector.IconPath); } if (injector.OutPath != null) { Cll.Log.WriteLine("out: " + injector.OutPath); } Cll.Log.WriteLine("encrypt: " + injector.Encrypt.ToString()); Cll.Log.WriteLine("Please wait..."); if (injector.Inject()) { MessageBox.Show("Injection completed successfully!", "DSInject", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("The injection failed.\nCheck the log file \"" + Cll.Log.Filename + "\".", "DSInject", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }