void ReadDataSPIThread() //ReadSerial/ParSPI { if (selectedIC == "93C66") { IC.EEPROM_93C66 ic; if (selectedPorts == Ports[1]) { ic = new MemoryProgrammer.IC.EEPROM_93C66(portAddress, 500000, this); } else if (selectedPorts == Ports[2]) { ic = new MemoryProgrammer.IC.EEPROM_93C66(portName, 50, this); } else { return; } timer1.Enabled = true; try { ic.StartTransfer(); } catch (Exception err) { MessageBox.Show(err.Message); return; } hex = ""; for (int x = 0; x < 256; x++) { UInt32 val = ic.EEPROM_93C66_spi_read_data(x); hex += val.ToString("X4"); progress = x / 256 * 100; } ic.StopTransfer(); this.BeginInvoke(new SetTextDeleg(tampilkanData), new object[] { hex }); byteviewer.SetBytes(StringToByteArray(hex)); progress = 100; } }
public ByteViewerForm() { InitializeForm(); byteviewer = new ByteViewer(); byteviewer.Location = new Point(8, 46); byteviewer.Size = new Size(600, 338); byteviewer.Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; byteviewer.SetBytes(new byte[] { }); this.Controls.Add(byteviewer); this.Icon = global::Hex.Properties.Resources._59031_5ea_icon; }
public ByteViewerForm() { // Initialize the controls other than the ByteViewer. InitializeForm(); // Initialize the ByteViewer. byteviewer = new ByteViewer(); byteviewer.Location = new Point(8, 46); byteviewer.Size = new Size(600, 338); byteviewer.Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; byteviewer.SetBytes(new byte[] { }); this.Controls.Add(byteviewer); }
public ByteViewerForm() { // Initialize the controls other than the ByteViewer. InitializeForm(); // Initialize the ByteViewer. byteviewer = new ByteViewer(); byteviewer.Location = new Point( 8, 46 ); byteviewer.Size = new Size( 600, 338 ); byteviewer.Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; byteviewer.SetBytes( new byte[] { } ); this.Controls.Add( byteviewer ); }
public Form1() { InitializeComponent(); // Initialize the ByteViewer. byteviewer = new ByteViewer(); byteviewer.Location = textBoxString.Location; // new Point(8, 46); byteviewer.Size = textBoxString.Size; // new Size(600, 338); byteviewer.Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; byteviewer.SetBytes(new byte[] { }); this.Controls.Add(byteviewer); textBoxString.Visible = false; }
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { // Get the BackgroundWorker that raised this event. BackgroundWorker worker = sender as BackgroundWorker; while (worker.CancellationPending != true) { if (pauseBackgroundWorker == false) { Scanner.refreshLastZone(); try { byteviewer.Invoke((MethodInvoker) delegate { byteviewer.SetBytes(Scanner.ScannerBuffer); }); } catch (Exception ex) { MessageBox.Show("backgroundWorker1_DoWork: " + ex.Message); } } } }
public ByteViewerForm(byte[] b, string name) { // Initialize the controls other than the ByteViewer. InitializeForm(); // Initialize the ByteViewer. byteviewer = new ByteViewer(); byteviewer.Location = new Point(8, 46); byteviewer.Size = new Size(600, 338); byteviewer.Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; byteviewer.SetDisplayMode(DisplayMode.Hexdump); byteviewer.SetBytes(b); this.MaximizeBox = false; this.FormBorderStyle = FormBorderStyle.FixedSingle; this.Controls.Add(byteviewer); this.Name = "Binary Viewer - " + name; this.Text = "Binary Viewer - " + name; }
public HexViewer() { // Initialize the controls other than the ByteViewer. InitializeForm(); // Initialize the ByteViewer. byteviewer = new ByteViewer(); byteviewer.Disposed += new System.EventHandler(this.disposed); byteviewer.Location = new Point(8, 46); byteviewer.Size = new Size(600, 338); byteviewer.Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Top; byteviewer.SetBytes(Scanner.ScannerBuffer); this.Controls.Add(byteviewer); this.Show(); this.FormClosing += new FormClosingEventHandler(formClosingCallback); backgroundWorker1 = new System.ComponentModel.BackgroundWorker(); backgroundWorker1.WorkerReportsProgress = false; backgroundWorker1.WorkerSupportsCancellation = true; backgroundWorker1.DoWork += new DoWorkEventHandler(backgroundWorker1_DoWork); pauseBackgroundWorker = true; }
public BlockInfo(wCpuBlock block) { InitializeComponent(); Text = "Block Information - " + block.ToString(); txtBlock.Text = block.ToString(); txtName.Text = block.name; txtAuthor.Text = block.author; txtFamily.Text = block.family; txtLanguage.Text = block.language.ToString(); txtLocalData.Text = block.localData.ToString(); txtLoadSize.Text = block.loadSize.ToString() + " bytes"; txtMC7Size.Text = block.MC7Size.ToString() + " bytes"; txtSBBLength.Text = block.SBBLength.ToString() + " bytes"; txtCodeDate.Text = block.codeDate; txtInterfaceDate.Text = block.interfaceDate; //Format checksum as hex (ab cd) txtChecksum.Text = block.checksum.ToString("x4").Insert(2, " "); txtFlags.Text = block.blockFlags.ToString("x4").Insert(2, " "); txtVersion.Text = block.version.ToString("x4").Insert(2, " "); //TODO Fix this shit if (block.data != null && false) { ByteViewer bv = new ByteViewer(); bv.SetBytes(block.data); bv.Location = new Point(12, 148); bv.Size = new Size(419, 222); Controls.Add(bv); byte[] data = new byte[block.loadSize - 10]; Array.Copy(block.data, data, data.Length); txtTestChecksum.Text = Crc16.ComputeChecksum(data).ToString("x4").Insert(2, " "); } else { } }
protected override void Show( IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider) { object data = objectProvider.GetObject(); using (Form f = new Form()) using (ByteViewer viewer = new ByteViewer()) { if (data is nDNS.Message) viewer.SetBytes(((nDNS.Message) data).RawBytes); else return; viewer.SetDisplayMode(DisplayMode.Hexdump); viewer.Dock = DockStyle.Fill; f.FormBorderStyle = FormBorderStyle.SizableToolWindow; f.Text = "DNS Packet Byte Array Viewer"; f.ClientSize = viewer.Size; f.Controls.Add(viewer); windowService.ShowDialog(f); } }
private void clearBytes(object sender, EventArgs e) { byteviewer.SetBytes(new byte[] { }); GC.Collect(); }