private void SetWatchpointButton_Click(object sender, EventArgs e) { PS4DBG.WATCHPT_LENGTH watchptLength = PS4DBG.WATCHPT_LENGTH.DBREG_DR7_LEN_1; string text1 = this.WatchpointLengthComboBox.Text; if (!(text1 == "1 byte")) { if (!(text1 == "2 bytes")) { if (!(text1 == "4 bytes")) { if (text1 == "8 bytes") { watchptLength = PS4DBG.WATCHPT_LENGTH.DBREG_DR7_LEN_8; } } else { watchptLength = PS4DBG.WATCHPT_LENGTH.DBREG_DR7_LEN_4; } } else { watchptLength = PS4DBG.WATCHPT_LENGTH.DBREG_DR7_LEN_2; } } else { watchptLength = PS4DBG.WATCHPT_LENGTH.DBREG_DR7_LEN_1; } PS4DBG.WATCHPT_BREAKTYPE watchptBreaktype = PS4DBG.WATCHPT_BREAKTYPE.DBREG_DR7_EXEC; string text2 = this.BreaktypeComboBox.Text; if (!(text2 == "execute")) { if (!(text2 == "write")) { if (text2 == "read/write") { watchptBreaktype = PS4DBG.WATCHPT_BREAKTYPE.DBREG_DR7_RDWR; } } else { watchptBreaktype = PS4DBG.WATCHPT_BREAKTYPE.DBREG_DR7_WRONLY; } } else { watchptBreaktype = PS4DBG.WATCHPT_BREAKTYPE.DBREG_DR7_EXEC; } this.ps4.ChangeWatchpoint((int)this.WatchpointNumericUpDown.Value, true, watchptLength, watchptBreaktype, this.address); }
private void ScanDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e) { DataGridView dataGridView = (DataGridView)sender; if (!(dataGridView.Columns[e.ColumnIndex] is DataGridViewButtonColumn) || e.RowIndex < 0) { return; } ulong uint64 = Convert.ToUInt64(dataGridView.Rows[e.RowIndex].Cells[0].Value.ToString().Trim().Replace("0x", ""), 16); ulong typeLength = (ulong)MemoryScanner.GetTypeLength(dataGridView.Rows[e.RowIndex].Cells[1].ToString().Trim()); PS4DBG.WATCHPT_LENGTH watchptLength = PS4DBG.WATCHPT_LENGTH.DBREG_DR7_LEN_1; switch ((long)typeLength - 1L) { case 0: watchptLength = PS4DBG.WATCHPT_LENGTH.DBREG_DR7_LEN_1; goto case 2; case 1: watchptLength = PS4DBG.WATCHPT_LENGTH.DBREG_DR7_LEN_2; goto case 2; case 2: this.ps4.ChangeWatchpoint((int)this.WatchpointNumericUpDown.Value, true, watchptLength, PS4DBG.WATCHPT_BREAKTYPE.DBREG_DR7_WRONLY, uint64); break; case 3: watchptLength = PS4DBG.WATCHPT_LENGTH.DBREG_DR7_LEN_4; goto case 2; default: if (typeLength == 8UL) { watchptLength = PS4DBG.WATCHPT_LENGTH.DBREG_DR7_LEN_8; goto case 2; } else { goto case 2; } } }