Live data from Hacker News

Your hex editor should color-code bytes

simonomi.dev

61–70 of 165 posts

Re: Your hex editor should color-code bytes

#61

ImHex ( https://imhex.werwolv.net/ ) is also a really nice Hex editor with tons of plugins (patterns, file support, etc.) and even an embedded language for adding more patterns easily

+1 for ImHex - I've had a lot of fun with Pattern Language lately .. its quite fruitful to, for instance, have an AI take a few headers worth of input to produce some PL code which highlights all the things very well. For a while I almost forget I'm in a hex editor and not in some custom data wrangling environment ..

Re: Your hex editor should color-code bytes

#62
post #60

When (rarely) using hex editors, one thing constantly comes to my mind: isn't base 16 arabic-roman numerals a bit awkward for "skimmable" overview? Color-coding indeed helps immensely there, but wouldn't simply letting bits and bops shine in eight bit clusters, resembling the "physical" shape of the eight-bit byte, be somewhat more readable? We even have characters in the Unicode for representing 0..255 variations, a…

This is a great idea and I concur with your line of thought - there is room for expression in the realm of number representations .. have you considered building an ImHex plugin that would illustrate your point? The use of octants is particularly intriguing ..

One thing I often ponder on, along similar lines, is whether I can write some clever plugin that would put FF ChartWell - a font which uses ligatures to render useful graphs out of boring numerical data - into use, within ImHex. Seen how ligatures can be used this way?

https://typographica.org/typeface-reviews/chartwell/

Your idea of discovering new means of representing numeral data put me in mind of ligature hacking, in any case ...

Re: Your hex editor should color-code bytes

#63
DEFCON30, Mayhem CTF.

We were given a file full of random bytes. The flag was in there somewhere. It was too random to be encrypted, there wasn't any structure. `file` didn't return anything, truly just a bag of bytes.

I had decided to install `hexyl` as an alternative option to some of the other hex editors installed o my linux machine. All the bytes were colored grey.

I scrolled the file and noticed a blip of yellow. A random golden `{` amongst all the noise. Weird.

The next colored byte was a `C`, then `T`, `F`.

---

At that time, I was mostly using HexFiend to look at raw files, which didn't have byte coloring. For DEFCON I had decided to drive my linux machine. I had ghex installed, but i had also decided to install and try `hexyl` via cli. So seeing bytes in color was purely by chance that I had installed it. I eventually posted an issue to ghex to add color support. https://gitlab.gnome.org/GNOME/ghex/-/issues/60

I need to see if I can find the file and post it on that blog post. https://bwiggs.com/posts/2023-08-31-hacking-in-color/

Re: Your hex editor should color-code bytes

#64
post #35

Everything should try do some basic syntax highlighting IMO. Not too much, or it just becomes a sea of formatting that doesn't help at all. It is surprising how much difference just a little splash of colour can make if it isn't overdone. If possible, always include configuration options for the user though, so those with colour-blindness issues can tweak things to their needs, those who are just fussy can make the o…

I'd recommend for every developer to get one or more colourblind friends. I have some, and regularly send them screenshots of what I'm working on to get feedback what they can see and what they can read/can't read. They've been absolutely invaluable for making sure their kind of people can't use my apps properly.

Get more than one, someone with red-green and blue-yellow color blindness are going to have completely different experiences

Re: Your hex editor should color-code bytes

#65
post #63

DEFCON30, Mayhem CTF. We were given a file full of random bytes. The flag was in there somewhere. It was too random to be encrypted, there wasn't any structure. `file` didn't return anything, truly just a bag of bytes. I had decided to install `hexyl` as an alternative option to some of the other hex editors installed o my linux machine. All the bytes were colored grey. I scrolled the file and noticed a blip of yello…

> It was too random to be encrypted

That's a rather odd remark.

Re: Your hex editor should color-code bytes

#67
post #65
post #63

DEFCON30, Mayhem CTF. We were given a file full of random bytes. The flag was in there somewhere. It was too random to be encrypted, there wasn't any structure. `file` didn't return anything, truly just a bag of bytes. I had decided to install `hexyl` as an alternative option to some of the other hex editors installed o my linux machine. All the bytes were colored grey. I scrolled the file and noticed a blip of yello…

> It was too random to be encrypted That's a rather odd remark.

You would still expect some amount of file structure, ex byte headers or something at the beginning/end of file. no?

Re: Your hex editor should color-code bytes

#68
post #48

Everything should try do some basic syntax highlighting IMO. Not too much, or it just becomes a sea of formatting that doesn't help at all. It is surprising how much difference just a little splash of colour can make if it isn't overdone. If possible, always include configuration options for the user though, so those with colour-blindness issues can tweak things to their needs, those who are just fussy can make the o…

> Everything should try do some basic syntax highlighting IMO. Interesting idea. So even syntax–highlighting natural language. Grammar highlighting, as it were. Prepositions, verbs, question marks, etc. An LLM could do it. Would it actually improve readability though? Seems likely!

I always enjoy to find people who think so drastically differently than myself. This sounds like an absolute nightmare to me and I would gauge my eyes out.

Re: Your hex editor should color-code bytes

#69
post #35

Everything should try do some basic syntax highlighting IMO. Not too much, or it just becomes a sea of formatting that doesn't help at all. It is surprising how much difference just a little splash of colour can make if it isn't overdone. If possible, always include configuration options for the user though, so those with colour-blindness issues can tweak things to their needs, those who are just fussy can make the o…

I'd recommend for every developer to get one or more colourblind friends. I have some, and regularly send them screenshots of what I'm working on to get feedback what they can see and what they can read/can't read. They've been absolutely invaluable for making sure their kind of people can't use my apps properly.

Pro-tip: there are browser extensions able to simulate various kinds of color blindness.

That is better then a random friend, because a.) there are various kinds of colorblindness b.) you wont ask the random friend to work for your company for free.

Re: Your hex editor should color-code bytes

#70
post #39
post #35

Earlier quoted context omitted.

I'd recommend for every developer to get one or more colourblind friends. I have some, and regularly send them screenshots of what I'm working on to get feedback what they can see and what they can read/can't read. They've been absolutely invaluable for making sure their kind of people can't use my apps properly.

8% of the male population has some form of colorblindness (for women it’s around 0.5%). I have deuteranomaly colorblindness. If you search for images on the internet related to that type of colorblindness you’ll find representations of how we see color and how we see the world. It is not a fun condition to have, and leads to lots of problems in my everyday life. This blog post accidentally accentuated that issue, sin…

Most color blind men are mildly color blind, plenty even go through their lives without noticing.

Yours is on the much stronger side of the things.

Post reply on HN