コード例 #1
0
        public void GotoAddress(uint address)
        {
            currAddress = address;
            uint pos = address;

            listBox2.Items.Clear();
            byte[]   buf      = GetFunctionBytes(address, toolStripButton6.Checked);
            string[] opDisAsm = Disassembler.Disassemble(buf, pb1);
            for (uint i = 0; i < opDisAsm.Length; i++)
            {
                string opBytes = buf[i * 4].ToString("X2") + " " + buf[i * 4 + 1].ToString("X2") + " " + buf[i * 4 + 2].ToString("X2") + " " + buf[i * 4 + 3].ToString("X2");
                string hasBP   = Debugger.breakPoints.Contains(pos) ? "* " : "";
                string comment = "";
                uint   u       = PPC.SwapEndian(BitConverter.ToUInt32(buf, (int)i * 4));
                uint   target;
                if (PPC.isBranchOpc(u) && PPC.calcBranchTarget(u, pos, out target))
                {
                    comment = "\t#[loc_" + target.ToString("X8") + "]";
                }
                listBox2.Items.Add(hasBP + pos.ToString("X8") + "\t: " + opBytes + "\t" + opDisAsm[i] + comment);
                pos += 4;
            }
        }