Need some advice for a hex editor

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MrNobody

    Need some advice for a hex editor

    I would like to make a quick little hex editor so I need to display hex
    string pairs like a grid- if anyone is familiar with hex editors you'll know
    what I mean. I could accomplish this by using a regular TextBox and using
    monospace font and just adding a space between each pair so it would look
    like "A5 76 FF 3B" etc...

    Another approach I guess would be to have a plain white pane and then
    manually draw the strings- calculating proper x y coords.

    What approach you think is better?

    I would need to add functionality where I can both select a string of hex
    value or click on one to highlight it (not just one character a pair but the
    whole pair) So If I clicked the 5 in A5 the whole pair would be selected,
    they should really act as one individual entity since it is one byte
    represented in 2 digit hex.

    I'll also need to add searching and pattern matching so if I use a TextBox
    and throw in space all over it might make it more difficult to do this.


    Any suggestions?


  • Richard Jalbert

    #2
    Re: Need some advice for a hex editor

    On Thu, 29 Sep 2005 10:31:05 -0700, "=?Utf-8?B?TXJOb2JvZHk =?="
    <MrNobody@discu ssions.microsof t.com> wrote:
    [color=blue]
    >I would like to make a quick little hex editor so I need to display hex
    >string pairs like a grid- if anyone is familiar with hex editors you'll know
    >what I mean. I could accomplish this by using a regular TextBox and using
    >monospace font and just adding a space between each pair so it would look
    >like "A5 76 FF 3B" etc...[/color]

    This would be the best I think (at least, that's what I would do) IF
    you meant only to read out the values.
    [color=blue]
    >Another approach I guess would be to have a plain white pane and then
    >manually draw the strings- calculating proper x y coords.[/color]

    Editing these would be iffy, to say the least.
    You would have to store the coordinates with each value so as to
    "find" them again.
    [color=blue]
    >What approach you think is better?[/color]

    But if I wanted to edit and store back the modified values, I would
    store each byte in a grid as it is read from the file and then read
    them from that grid to save them back to the file: no need of any
    structure, the grid being the data storage "class".
    [color=blue]
    >I would need to add functionality where I can both select a string of hex
    >value or click on one to highlight it (not just one character a pair but the
    >whole pair) So If I clicked the 5 in A5 the whole pair would be selected,
    >they should really act as one individual entity since it is one byte
    >represented in 2 digit hex.
    >
    >I'll also need to add searching and pattern matching so if I use a TextBox
    >and throw in space all over it might make it more difficult to do this.[/color]
    [color=blue]
    >Any suggestions?
    >
    >[/color]

    Comment

    • William Stacey [MVP]

      #3
      Re: Need some advice for a hex editor

      I would do the text box thing and select the two on a click event or
      something.

      --
      William Stacey [MVP]

      "MrNobody" <MrNobody@discu ssions.microsof t.com> wrote in message
      news:B0715BCF-2025-41B8-8EEC-A2EDFDD1F587@mi crosoft.com...[color=blue]
      >I would like to make a quick little hex editor so I need to display hex
      > string pairs like a grid- if anyone is familiar with hex editors you'll
      > know
      > what I mean. I could accomplish this by using a regular TextBox and using
      > monospace font and just adding a space between each pair so it would look
      > like "A5 76 FF 3B" etc...
      >
      > Another approach I guess would be to have a plain white pane and then
      > manually draw the strings- calculating proper x y coords.
      >
      > What approach you think is better?
      >
      > I would need to add functionality where I can both select a string of hex
      > value or click on one to highlight it (not just one character a pair but
      > the
      > whole pair) So If I clicked the 5 in A5 the whole pair would be selected,
      > they should really act as one individual entity since it is one byte
      > represented in 2 digit hex.
      >
      > I'll also need to add searching and pattern matching so if I use a TextBox
      > and throw in space all over it might make it more difficult to do this.
      >
      >
      > Any suggestions?
      >
      >[/color]


      Comment

      Working...