Simple Hex Editor – C#

Sometimes it’s all about having the right tool for editing. I’ve built a hex editor which can come in handy for many of those users who want to edit files (especially the binary ones). It can also be used in your program because I added the argument option.

It’s written in C# with .NET 2.0

Features:
- View file in hex
- Edit at provided offset (hex or int) – to provide a hex number please insert H in the front of the number, for example: 2D will be H2D
- Find specified string (use 0 to specify a null character)
- Edit from command line : hexeditor.exe path offset value , for example: hexeditor.exe “c:test.exe” H23 test

Download:

Source code: http://rapidshare.com/files/95709335/HexEditor.rar.html
Binary file: http://rapidshare.com/files/95709694/HexEditor.exe.html
.NET Framework: http://www.microsoft.com/downloads/…displaylang=en

6 Responses to “Simple Hex Editor – C#”

  1. Mario Says:

    To prevent a nasty crash, you might want to add this …

    private void OpenFile_Click(object sender, EventArgs e)
    {
    path = txtFileName.Text;

    if (path.Length == 0)
    {
    MessageBox.Show(“Please enter a file name!”);
    return;
    }

    if ( !File.Exists(path) )
    {
    MessageBox.Show(“No such file!”);
    return;
    }

  2. Mario Says:

    I failed to mention that the fix above is for the case when you select the open button with an invalid (or no) file entry.

  3. dranaxum Says:

    Mario, thanks for the feedback.
    I knew I didn’t deal with that problem the minute I published the it on this blog. The fact is that I wanted to stick to the idea and not very much on the actual code. Anyway it’s not a very big problem/bug! :)

  4. Nadine Says:

    Hi there,
    Thanks for sharing this master piece with us all:

    Good Luck
    Nadine

  5. prajwalan Says:

    A very cool sample.

    Keep it up.


Leave a Reply