private void rangeView_DoubleClick(object sender, EventArgs e) { IBArg[] a = new IBArg[2]; a[0].defStr = rangeView.Items[rangeListIndex].SubItems[0].Text; a[0].label = "Start Address"; a[1].defStr = rangeView.Items[rangeListIndex].SubItems[1].Text; a[1].label = "End Address"; a = CallIBox(a); if (a == null) return; if (a[0].retStr.Length == 8) rangeView.Items[rangeListIndex].SubItems[0].Text = a[0].retStr; else rangeView.Items[rangeListIndex].SubItems[0].Text = a[0].defStr; if (a[1].retStr.Length == 8) rangeView.Items[rangeListIndex].SubItems[1].Text = a[1].retStr; else rangeView.Items[rangeListIndex].SubItems[1].Text = a[1].defStr; //Update range array UpdateMemArray(); }
/* Brings up the Input Box with the arguments of a */ public IBArg[] CallIBox(IBArg[] a) { InputBox ib = new InputBox(); ib.Arg = a; ib.fmHeight = this.Height; ib.fmWidth = this.Width; ib.fmLeft = this.Left; ib.fmTop = this.Top; ib.TopMost = true; ib.fmForeColor = ForeColor; ib.fmBackColor = BackColor; ib.Show(); while (ib.ret == 0) { a = ib.Arg; Application.DoEvents(); } a = ib.Arg; if (ib.ret == 1) return a; else if (ib.ret == 2) return null; return null; }
/* Connects to PS3 */ private void connectButton_Click(object sender, EventArgs e) { this.statusLabel1.Text = "Connecting..."; try { if (apiDLL == 0) //TMAPI { if (PS3.ConnectTarget()) { connected = true; this.statusLabel1.Text = "Connected"; connectButton.Enabled = false; attachProcessButton.Enabled = true; toolStripDropDownButton1.BackColor = Color.DarkGoldenrod; } } else //CCAPI { IBArg[] ibArg = new IBArg[1]; ibArg[0].defStr = (IPAddrStr == "") ? "0.0.0.0" : IPAddrStr; ibArg[0].label = "PS3 IP Address"; ibArg = CallIBox(ibArg); if (ibArg == null) { this.statusLabel1.Text = "Cancelled Connecting"; return; } IPAddrStr = ibArg[0].retStr; if (ibArg[0].retStr != "") { if (PS3.ConnectTarget(ibArg[0].retStr)) { connected = true; this.statusLabel1.Text = "Connected"; connectButton.Enabled = false; attachProcessButton.Enabled = true; toolStripDropDownButton1.BackColor = Color.DarkGoldenrod; } } } if (connected == false) { this.statusLabel1.Text = "Failed to connect to PS3"; connected = false; } } catch { this.statusLabel1.Text = "Failed to connect to PS3"; connected = false; } }