コード例 #1
0
 public mcontext(gpregs mc_gpregs = default, fpregs mc_fpregs = default, int mc_flags = default, int mc_pad = default, array <ulong> mc_spare = default)
 {
     this.mc_gpregs = mc_gpregs;
     this.mc_fpregs = mc_fpregs;
     this.mc_flags  = mc_flags;
     this.mc_pad    = mc_pad;
     this.mc_spare  = mc_spare;
 }
コード例 #2
0
        private void DebuggerInterruptCallback(
            uint lwpid,
            uint status,
            string tdname,
            regs regs,
            fpregs fpregs,
            dbregs dbregs)
        {
            var tabControlDelegate =
                // new Action<object, object>((_param1, _param2) => this.TabControl.SelectedIndex = 0);
                new Action(() => this.TabControl.SelectedIndex = 0);
            var registersTextBoxDelegate = new Action(() =>
                                                      this.RegistersTextBox.Text = "r15 = 0x" + regs.r_r15.ToString("X") +
                                                                                   ", r14 = 0x" + regs.r_r14.ToString("X") +
                                                                                   ", r13 = 0x" + regs.r_r13.ToString("X") +
                                                                                   ", r12 = 0x" + regs.r_r12.ToString("X") +
                                                                                   ", r11 = 0x" + regs.r_r11.ToString("X") +
                                                                                   ", r10 = 0x" + regs.r_r10.ToString("X") +
                                                                                   ", r9 = 0x" + regs.r_r9.ToString("X") +
                                                                                   ", r8 = 0x" + regs.r_r8.ToString("X") +
                                                                                   ", rdi = 0x" + regs.r_rdi.ToString("X") +
                                                                                   ", rsi = 0x" + regs.r_rsi.ToString("X") +
                                                                                   ", rbp = 0x" + regs.r_rbp.ToString("X") +
                                                                                   ", rbx = 0x" + regs.r_rbx.ToString("X") +
                                                                                   ", rdx = 0x" + regs.r_rdx.ToString("X") +
                                                                                   ", rcx = 0x" + regs.r_rcx.ToString("X") +
                                                                                   ", rax = 0x" + regs.r_rax.ToString("X") +
                                                                                   ", trapno = 0x" + regs.r_trapno.ToString("X") +
                                                                                   ", fs = 0x" + regs.r_fs.ToString("X") +
                                                                                   ", gs = 0x" + regs.r_gs.ToString("X") +
                                                                                   ", err = 0x" + regs.r_err.ToString("X") +
                                                                                   ", es = 0x" + regs.r_es.ToString("X") +
                                                                                   ", ds = 0x" + regs.r_ds.ToString("X") +
                                                                                   ", rip = 0x" + regs.r_rip.ToString("X") +
                                                                                   ", cs = 0x" + regs.r_cs.ToString("X") +
                                                                                   ", rflags = 0x" + regs.r_rflags.ToString("X") +
                                                                                   ", rsp = 0x" + regs.r_rsp.ToString("X") +
                                                                                   ", ss = 0x" + regs.r_ss.ToString("X"));
            var addressTextBoxDelegate = new Action(() =>
                                                    this.AddressTextBox.Text = "0x" + regs.r_rip.ToString("X"));
            var tryFindButtonDelegate = new Action(() =>
                                                   this.TryFindButton_Click((object)null, (EventArgs)null));

            this.ps4.Notify(222, "interrupt hit\n(thread: " + tdname + " id: " + (object)lwpid + ")");
            this.TabControl.Invoke(tabControlDelegate);
            this.RegistersTextBox.Invoke(registersTextBoxDelegate);
            this.AddressTextBox.Invoke(addressTextBoxDelegate);
            this.TryFindButton.Invoke(tryFindButtonDelegate);
            this.data = this.ps4.ReadMemory(this.attachpid, this.address, this.length);
            string[]      lines         = this.GetDisassembly(this.address, this.data);
            StringBuilder stringBuilder = new StringBuilder();

            for (int index = 1; index < lines.Length; ++index)
            {
                stringBuilder.AppendLine(lines[index]);
            }
            string after = stringBuilder.ToString();
            var    disassemblyTextBoxDelegate = new Action(() =>
            {
                this.DisassemblyTextBox.Clear();
                this.DisassemblyTextBox.AppendText(lines[0] + Environment.NewLine, Color.Salmon);
                this.DisassemblyTextBox.AppendText(after);
            });

            this.DisassemblyTextBox.Invoke(disassemblyTextBoxDelegate);
        }