Live data from Hacker News

Hexyl: A command-line hex viewer

github.com

41–50 of 119 posts

Re: Hexyl: A command-line hex viewer

#41
post #39

Earlier quoted context omitted.

I'm struggling to even find the canonical source code for xxd, let alone a way to provide a patch. You could probably email the address in the man page, but that's from 1997 so I wouldn't be too optimistic about getting a response. And even then it's quite likely that the original author considers xxd finished and would be reluctant to accept patches for it anyway. On top of all that the hard part of this work (cross…

Cross-platform terminal coloring was solved in the 1980s with termcap and then terminfo, for every terminal that's even come close to seeing mainstream use and which had colors in the first place. The libraries are part of the ncurses library and are shipped with every OS this stuff would build on to begin with. This also solves the problem of moving the cursor and drawing a screen in general.

Aren't termcap and terminfo linux (or maybe unix) only?

Re: Hexyl: A command-line hex viewer

#42
post #3

I admit, my first thought on seeing the title was "What's wrong with xxd?" This is nice! I like the colorization a lot -- it's like with source code, you don't realize how much you rely on the colors until you get a new computer and need to download syntax definitions for your editor again. Only feature I really think is missing is line numbers. Nicely done!

[deleted]

Re: Hexyl: A command-line hex viewer

#45
post #44

Sorry to ask, but what is he use case for a hex viewer like this? What are the kinds of projects you might be working on when you use something like this?

You come across an undescript binary. It might be a jpeg with an altered extension, malware or basically anything. You open it in a hex viewer and try to gather some info.

Re: Hexyl: A command-line hex viewer

#46
post #3

I admit, my first thought on seeing the title was "What's wrong with xxd?" This is nice! I like the colorization a lot -- it's like with source code, you don't realize how much you rely on the colors until you get a new computer and need to download syntax definitions for your editor again. Only feature I really think is missing is line numbers. Nicely done!

Just looked at manpages on someone else's account with no colour highlighting, definitely missed it.

Re: Hexyl: A command-line hex viewer

#47
post #39

Earlier quoted context omitted.

I'm struggling to even find the canonical source code for xxd, let alone a way to provide a patch. You could probably email the address in the man page, but that's from 1997 so I wouldn't be too optimistic about getting a response. And even then it's quite likely that the original author considers xxd finished and would be reluctant to accept patches for it anyway. On top of all that the hard part of this work (cross…

Cross-platform terminal coloring was solved in the 1980s with termcap and then terminfo, for every terminal that's even come close to seeing mainstream use and which had colors in the first place. The libraries are part of the ncurses library and are shipped with every OS this stuff would build on to begin with. This also solves the problem of moving the cursor and drawing a screen in general.

Eh, A lot of modern terminal emulators don't seem to bother providing termcap/info entries, or setting their own $TERM variables. In reality, most code just fires off ANSI sequences and hopes for the best. Looking quickly at the source for Hexyl, I think that's what the ansi_term library it uses does.

If anything, I've found doing this works better then trying to muck around with ncurses, which often gets actively mislead by incorrect terminfo entries.

Re: Hexyl: A command-line hex viewer

#49
post #40

the author appears to be a true rust master, he wrote quite a few neat programs in rust, very impressive and that actually got me interested in rust lang

Same here, I like small and neat Rust projects like this, the source code is concise and easy to read.

He also authors https://github.com/sharkdp/bat, which is also worth to check out.

Re: Hexyl: A command-line hex viewer

#50
I do not use a hex editor/viewer often. Not at all. But when I do, I am painfully aware of how sparse my toolbelt just became.

This little program should fit nicely into that category. An area I would like to explore, but have little-to-none incentives.

Post reply on HN