Exemplo n.º 1
0
	public void DisassembleBinaryLoadFile(BinaryLoadFile file, string destFileName)
	{
		StreamWriter sw = new StreamWriter(destFileName);
		StringBuilder s;
		BinaryLoadSegment seg = new BinaryLoadSegment();

		for (int i = 0; i <= file.SegmentCount - 1; i++) {
			seg = file.Segment(i);
			s = new StringBuilder();
			s.Append(string.Format("Segment {0}",i));
			s.Append(string.Format(", Start Address: {0}" ,seg.StartAddress));
			s.Append(string.Format(", End Address: {0}",seg.EndAddress));

			sw.WriteLine(s.ToString());
			sw.WriteLine("");

			disAsm = new M6502DASM(seg.Data, seg.StartAddress);

			sw.Write(disAsm.Disassemble());
		}

		sw.Close();
	}
Exemplo n.º 2
0
    private void itmBinaryDisasm_Click(System.Object sender, System.EventArgs e)
    {
        //Read file from Atari disk
        byte[] data = LoadSelectedFile();
        if (data == null) return;

        BinaryLoadFile bfile;

        try
        {
            bfile = new BinaryLoadFile(data);
        }
        catch (Exception ex)
        {
            MessageBox.Show("Could not load binary file. " + ex.Message);
            return;
        }

        FileDisasmViewer frmView = new FileDisasmViewer(bfile);
        frmView.MdiParent = this.MdiParent;
        frmView.Show();
    }
	public FileDisasmViewer(BinaryLoadFile file)
	{
		InitializeComponent();

		_file = file;
	}