Exemplo n.º 1
0
        private void toolStripButton7_Click(object sender, EventArgs e)
        {
            byte[]   buf      = GetFunctionBytes(currAddress);
            string[] opDisAsm = Disassembler.Disassemble(buf, pb1);
            string   content  = Disassembler.ExportForDecompiling(opDisAsm, buf, currAddress);

            File.WriteAllText("export\\exported.asm", content);
            File.WriteAllText("export\\functions.txt", currAddress.ToString("X8") + ";sub_" + currAddress.ToString("X8"));
            File.WriteAllBytes("export\\" + currAddress.ToString("X8") + ".bin", buf);
            if (File.Exists("export\\XEXDecompiler3.exe"))
            {
                Helper.RunShell("export\\XEXDecompiler3.exe", "export\\exported.asm");
            }
        }
Exemplo n.º 2
0
        public void GotoAddress(uint address)
        {
            uint count = 100;
            uint pos   = currAddress = address;

            listBox2.Items.Clear();
            byte[]   buf      = Debugger.GetMemoryDump(pos, 4 * count);
            string[] opDisAsm = Disassembler.Disassemble(buf);
            for (uint i = 0; i < count; 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) ? "* " : "";
                listBox2.Items.Add(hasBP + pos.ToString("X8") + "\t: " + opBytes + "\t" + opDisAsm[i]);
                pos += 4;
            }
        }
Exemplo n.º 3
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;
            }
        }