private void viewMBRToolStripMenuItem_Click(object sender, EventArgs e) { byte[] mbr = vhd.blockAllocationTable.GetSector(0); using (BinaryWriter b = new BinaryWriter(File.Open("mbr.bin", FileMode.Create))) { // 3. Use foreach and write all 12 integers. foreach (byte i in mbr) { b.Write(i); } } BiosPartitionRecord[] bpr = { new BiosPartitionRecord(mbr, 446, 0, 0), new BiosPartitionRecord(mbr, 462, 0, 0), new BiosPartitionRecord(mbr, 478, 0, 0), new BiosPartitionRecord(mbr, 494, 0, 0) }; // DiscUtils.Partitions.BiosPartitionTable bpt = new DiscUtils.Partitions.BiosPartitionTable(); Be.Windows.Forms.ByteCollection bc = new Be.Windows.Forms.ByteCollection(mbr); HextFormTest hexForm = new HextFormTest(); Be.Windows.Forms.DynamicByteProvider dbp = new Be.Windows.Forms.DynamicByteProvider(bc); hexForm.SetHexBox("mbr.bin"); hexForm.Icon = Icon; hexForm.Show(); }
public void PluginSelected() { Be.Windows.Forms.HexBox box = (Be.Windows.Forms.HexBox)Controls[0]; Be.Windows.Forms.ByteCollection c = new Be.Windows.Forms.ByteCollection(Data.Buffer); Be.Windows.Forms.DynamicByteProvider d = new Be.Windows.Forms.DynamicByteProvider(Data.Buffer); ((Be.Windows.Forms.HexBox)Controls[0]).ByteProvider = d; }
public HexDataEdit(string RecName, byte[] data, dFormIDLookupS formIDLookup) { InitializeComponent(); this.Icon = Properties.Resources.tesv_ico; this.formIDLookup = formIDLookup; Text += RecName; tbName.Text = RecName; Text += " (hex mode)"; dbytes = new Be.Windows.Forms.DynamicByteProvider(data); bytes = dbytes.Bytes; hexBox1.ByteProvider = dbytes; Canceled = true; }
public HexDataEdit(string RecName, byte[] data, dFormIDLookupS formIDLookup) { InitializeComponent(); this.Icon=Fomm.Properties.Resources.fomm02; this.formIDLookup=formIDLookup; Text+=RecName; tbName.Text=RecName; Text+=" (hex mode)"; dbytes=new Be.Windows.Forms.DynamicByteProvider(data); bytes=dbytes.Bytes; hexBox1.ByteProvider=dbytes; Canceled=true; }
public void PluginSelected() { Be.Windows.Forms.HexBox box = (Be.Windows.Forms.HexBox)Controls[0]; Be.Windows.Forms.ByteCollection c = new Be.Windows.Forms.ByteCollection(Data.Buffer); Be.Windows.Forms.DynamicByteProvider d = new Be.Windows.Forms.DynamicByteProvider(Data.Buffer); ((Be.Windows.Forms.HexBox)Controls[0]).ByteProvider = d; }