Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Recommendations for a Hex Viewer Control for Windows.Forms? [closed]

I need ability to display content in Hex View, like this from WinHex

Offset      0  1  2  3  4  5  6  7   8  9  A  B  C  D  E  F
00000000   EF BB BF 0D 0A 4D 69 63  72 6F 73 6F 66 74 20 56   ..Microsoft V
00000010   69 73 75 61 6C 20 53 74  75 64 69 6F 20 53 6F 6C   isual Studio Sol
00000020   75 74 69 6F 6E 20 46 69  6C 65 2C 20 46 6F 72 6D   ution File, Form
00000030   61 74 20 56 65 72 73 69  6F 6E 20 31 30 2E 30 30   at Version 10.00
00000040   0D 0A 23 20 56 69 73 75  61 6C 20 53 74 75 64 69   ..# Visual Studi
00000050   6F 20 32 30 30 38 0D 0A  50 72 6F 6A 65 63 74 28   o 2008..Project(
00000060   22 7B 46 31 38 34 42 30  38 46 2D 43 38 31 43 2D   "{F184B08F-C81C-
00000070   34 35 46 36 2D 41 35 37  46 2D 35 41 42 44 39 39   45F6-A57F-5ABD99

Please recommend a control. Thank you.

like image 458
Fred F. Avatar asked Mar 25 '10 22:03

Fred F.


3 Answers

There is a ByteViewer Control directly available in the .NET Framework. Here is how you can use it in a sample Winforms C# application (note: you need to reference the System.Design assembly):

public Form1()
{
    InitializeComponent();
    ...
    ByteViewer bv = new ByteViewer();
    bv.SetFile(@"c:\windows\notepad.exe"); // or SetBytes
    Controls.Add(bv);
}

And here is how it looks like:

enter image description here

like image 79
Simon Mourier Avatar answered Sep 18 '22 19:09

Simon Mourier


I have always used http://sourceforge.net/projects/hexbox/ which has a HexEditor control but can be also used in a read only mode.

like image 44
tyranid Avatar answered Sep 22 '22 19:09

tyranid


Wpf Hexeditor is a powerful and fully customisable user control for editing file or stream as hexadecimal, decimal and binary.

You can use it very easily in Wpf or WinForm application. Download the code and test the Wpf (C#, VB.NET) and WinForm (C#) samples.

https://github.com/abbaye/WPFHexEditorControl

<!-- XAML -->
<Control:HexaEditor/>
<Control:HexaEditor Width="NaN" Height="NaN"/>
<Control:HexaEditor Width="Auto" Height="Auto"/>
<Control:HexaEditor FileName={Binding FileNamePath} Width="Auto" Height="Auto"/>

Image1

like image 44
Derek Tremblay Avatar answered Sep 20 '22 19:09

Derek Tremblay