private void TargetContextMenu_Opening(object sender, CancelEventArgs e) { Int32 selectedCellCount = TargetList.GetCellCount(DataGridViewElementStates.Selected); if (selectedCellCount > 0) { int index = TargetList.SelectedRows[0].Index; bool Available = TargetList.Rows[index].Cells["mStatus"].Value.Equals("Available"); if (Available) { Target_Details.Enabled = true; SendOrbisPayload.Enabled = false; Target_Reboot.Enabled = true; Target_Shutdown.Enabled = true; Target_Suspend.Enabled = true; TitleDetails.Enabled = true; Locate_Target.Enabled = true; } else { Target_Details.Enabled = false; SendOrbisPayload.Enabled = true; Target_Reboot.Enabled = false; Target_Shutdown.Enabled = false; Target_Suspend.Enabled = false; TitleDetails.Enabled = false; Locate_Target.Enabled = false; } } }
// // Target Context Menu // private void SendPayload_Click(object sender, EventArgs e) { try { string PayloadPath = string.Empty; using (OpenFileDialog openFileDialog = new OpenFileDialog()) { openFileDialog.Title = "Open BIN File..."; openFileDialog.CheckFileExists = true; openFileDialog.CheckPathExists = true; openFileDialog.InitialDirectory = Properties.Settings.Default.BINDirectory; openFileDialog.Filter = "BIN files (*.BIN)|*.BIN"; openFileDialog.FilterIndex = 2; openFileDialog.RestoreDirectory = true; if (openFileDialog.ShowDialog() == DialogResult.OK) { PayloadPath = openFileDialog.FileName; Properties.Settings.Default.BINDirectory = Path.GetDirectoryName(openFileDialog.FileName); Properties.Settings.Default.Save(); } else { return; } } FileStream fPayload = File.Open(PayloadPath, FileMode.Open); if (fPayload.CanRead) { byte[] PayloadBuffer = new byte[fPayload.Length]; if (fPayload.Read(PayloadBuffer, 0, (int)fPayload.Length) == fPayload.Length) { Int32 selectedCellCount = TargetList.GetCellCount(DataGridViewElementStates.Selected); if (selectedCellCount > 0) { int index = TargetList.SelectedRows[0].Index; string TargetName = Convert.ToString(TargetList.Rows[index].Cells["mTargetName"].Value); if (!PS4.Target[TargetName].Payload.InjectPayload(PayloadBuffer)) { DarkMessageBox.ShowError("Failed to send payload to target please try again.", "Error: Failed to inject payload."); } } } else { DarkMessageBox.ShowError("Failed read payload from disc to target please try again.", "Error: Failed to inject payload."); } } fPayload.Close(); } catch { } }
public void SelectCurrentTarget() { Int32 selectedCellCount = TargetList.GetCellCount(DataGridViewElementStates.Selected); if (selectedCellCount > 0) { int index = TargetList.SelectedRows[0].Index; string SelectedTarget = Convert.ToString(TargetList.Rows[index].Cells["TargetName"].Value); PS4.TargetManagement.SetSelected(SelectedTarget); DialogResult = System.Windows.Forms.DialogResult.OK; } }
private void locateToolStripMenuItem_Click(object sender, EventArgs e) { try { Int32 selectedCellCount = TargetList.GetCellCount(DataGridViewElementStates.Selected); if (selectedCellCount > 0) { int index = TargetList.SelectedRows[0].Index; string TargetName = Convert.ToString(TargetList.Rows[index].Cells["mTargetName"].Value); PS4.Target[TargetName].Beep(2); } } catch { } }
private void TitleDetails_Click(object sender, EventArgs e) { try { Int32 selectedCellCount = TargetList.GetCellCount(DataGridViewElementStates.Selected); if (selectedCellCount > 0) { int index = TargetList.SelectedRows[0].Index; string TargetName = Convert.ToString(TargetList.Rows[index].Cells["mTargetName"].Value); PS4.Dialogs.GameDetails(PS4.Target[TargetName].Info.Title + "_00"); } } catch { } }
private void SendOrbisPayload_Click(object sender, EventArgs e) { try { Int32 selectedCellCount = TargetList.GetCellCount(DataGridViewElementStates.Selected); if (selectedCellCount > 0) { int index = TargetList.SelectedRows[0].Index; string TargetName = Convert.ToString(TargetList.Rows[index].Cells["mTargetName"].Value); if (!PS4.Target[TargetName].Payload.InjectPayload()) { DarkMessageBox.ShowError("Failed to send payload to target please try again.", "Error: Failed to inject payload."); } } } catch { } }
private void Target_Edit_Click(object sender, EventArgs e) { try { Int32 selectedCellCount = TargetList.GetCellCount(DataGridViewElementStates.Selected); if (selectedCellCount > 0) { int index = TargetList.SelectedRows[0].Index; string TargetName = Convert.ToString(TargetList.Rows[index].Cells["mTargetName"].Value); if (PS4.Dialogs.EditTarget(TargetName) == DialogResult.OK) { UpdateTargetList(); } } } catch { } }
private void Target_Delete_Click(object sender, EventArgs e) { try { Int32 selectedCellCount = TargetList.GetCellCount(DataGridViewElementStates.Selected); if (selectedCellCount > 0) { int index = TargetList.SelectedRows[0].Index; string TargetName = Convert.ToString(TargetList.Rows[index].Cells["mTargetName"].Value); if (DarkMessageBox.ShowInformation("Are you sure you want to delete Target \"" + TargetName + "\"?", "Delete Target?", DarkDialogButton.YesNo) == DialogResult.Yes) { PS4.Target[TargetName].Delete(); UpdateTargetList(); } } } catch { } }