Need some advice for a hex editor

G

Guest

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?
 
R

Richard Jalbert

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...

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

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.
What approach you think is better?

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".
 
W

William Stacey [MVP]

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top