Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
ImHex – A Hex Editor (github.com/werwolv)
314 points by awb on Dec 9, 2020 | hide | past | favorite | 78 comments


ImHex uses capstone to map hex values to opcodes, depending on which ISA (Instruction Set Architecture) you have choosen. That makes it a nifty little tool for reverse engineering. http://www.capstone-engine.org/

Under the hood, Capstone use LLVM's TableGen as a source for descriptions of registers and opcodes. http://llvm.org/docs/TableGen/index.html

I've given ImHex a test run on an Amiga binary and it kind of works. However, the Amiga Hunk format (equivalent of ELF) is not recognized, and is interpreted as opcodes. Also there are issues with copper lists.


For a web-based editor, I use https://hexed.it. Or HexFiend if I need to load up larger binaries.


Any chance for a different font that has antialiasing? I find non-antialiased fonts very hard to read.

https://github.com/ocornut/imgui/blob/master/docs/FAQ.md#q-h...


I believe this is implemented.

You will have to edit imgui.ini which is generated after launching the program once.


How do I set a font? The only thing revealed by Ctrl+F is FontScale, which produces blurry results for any value greater than 1.


My apologies. I remembered it incorrectly. Here's what the developer said when I asked for this. (it's coming) https://github.com/WerWolv/ImHex/issues/22


http://ridiculousfish.com/hexfiend/

Another open source macOS one to consider.


I recently learned that it has a ”Template” feature that lets you write Tcl scripts to interpret the data in the file. It’s very easy to use and very useful too! I’ve written scripts to parse our internal file formats and pretty-print the interesting bits.


I've constantly using it


this is the one I use. I use it for large files and it's ok


This is one of the few apps that can open/edit gigabyte files on MacOS without choking.


The title seems pretty unkind to the project and I almost skipped it. “Bleh bleh yet another hex editor”.

But this has some nice features! For example, it can parse the executables, and show structures:

Disassembler supporting many different architectures ARM32 (ARM, Thumb, Cortex-M, aarch32) ARM64 MIPS (MIPS32, MIPS64, MIPS32R6, Micro) x86 (16 bit, 32 bit, 64 bit)

Just to start, along with a ton of other file parsing, etc.

This looks pretty cool. Compiling it needs a C++20 compiler and no small list of dependencies...but it’s cool.


Submitted title ("ImHex – A Hex Editor for people that value their eye sight") seems distracting and baity, so I've shortened it for now. If there's a better (more accurate and neutral) title, we can change it again.


Yeah, the "for people that value their eye sight when working at 3 AM" got to me. I knew it had to mean that dark mode was a big feature here.

I don't know if this editor offers a light mode. I hope it does. I love good hex editors, and this one looks very interesting. But light mode is a necessity for me because of my vision.

I have no quarrel with anyone who only wants to implement dark modes, it just means I won't be able to use their products.


If it is a really good product you want to use anyway, there are programs that can invert the screen for you so you can use them. And the gamma settings in some display drivers can be set to invert too. Not so handy if it's an art program though...


From their "About" section & README:

> A Hex Editor for Reverse Engineers, Programmers and people that value their eye sight when working at 3 AM.

Or their announcement page (https://werwolv.net/projects):

> A Hex editor with data pattern support and many features useful for Reverse Engineers

Maybe "ImHex - A Hex Editor for Reverse Engineers" would be a better title?


I saw that, but could not find anything that's especially for reverse engineers.

The union of "reverse engineers" and "programmers" is just "programmers", and that basically means "a hex editor for people who use hex editors". No?


Not all "reverse engineers" are programmers. When I was younger, I liked hacking game saves, it isn't programming, you don't write programs, you don't even touch machine code, only data.

There is a strong overlap, but it is still a different set of skills and different tools (ex: hex editor vs IDE)


The union of "humans" and "animals" is just "animals". Does that make a "home for humans and animals" basically the same thing as a "home for animals"?

You should know better than to draw that equivalence, dang.


What animals consider a home varies a lot. What programmers consider a hex editor, not so much.

If someone wants to point out what about this hex editor makes it more suitable for reverse engineers than the median text editor, I'll happily edit the title. The point is there needs to be something.


A home for humans has useful things for humans even if it also supports animals. So it’s still a home for humans.


This looks a much better title and match.


dang, any reason this can't be used?


It has constant-dark-mode tag, so can be called "constant dark mode hex editor". The eyesight part is simply misleading, dark mode is the last thing I would associate with that.


> and no small list of dependencies...

And that is why AppImage (as dev of ReHex did[0]) is much better way to provide binary for Linux, than ZIPed static linked binary package.

Just trying to execute binary from release asset `ImHex_1.5.0_Linux.zip`[0] under Debian 10:

    $ ./ImHex
    ./ImHex: error while loading shared libraries: libglfw.so.3: cannot open shared object file: No such file or directory

UPD: And just after install one dependency, there is another one

    $ ./ImHex
    ./ImHex: error while loading shared libraries: libcapstone.so.4: cannot open shared object file: No such file or directory
[0] https://buildkite.com/solemnwarning/rehex/builds

[1] https://github.com/WerWolv/ImHex/releases


> Compiling it needs a C++20 compiler

There have been discussions here about modern C++ example code. Lots of projects that use C++11, C++14 and a few C++17 codebases are suggested, but I've not seen a recommendation for a C++20 codebase to study - this might be one.


I love how their landing page includes a couple screenshots that show off some of these distinguishing features at a glance.


In the screenshot, there is one for "data information" - in that, what does the byte distribution and entropy chart help in understanding?


Not sure about byte distribution, but the entropy chart is going to be finding encryption keys.


Quote: "Doesn't burn out your retinas when used in late-night sessions"

I like white background and bright color themes, as in I like my retina "burned". Does it has settings where you can choose your own color scheme or this tool is on the same par with all "cool kids" who think anyone not using dark mode is unworthy?


I have quite strong astigmatism (although I've never heard it referred to as a "disability"). I am completely unable to use software with a dark background.

If dark mode is enforced, then me and a lot of other people are excluded from using it.


My girlfriend is the opposite, also serious eye problems but very sensitive to light. She embraces dark mode.

I'm in the middle, I prefer dark modes for my day to day work though.


Same!


It seems to be using ImGui. In source/window.cpp, line 269 you should be able to change ImGui::StyleColorsDark(); to ImGui::SyleColorsLight();


[flagged]


What are you talking about? Where, in God's name, on my above comment I even hinted at that? All I am saying is if you go the trouble to create something that has different color scheme than your underlying operating system, then be smart enough to create settings to let users select their own colors.

You either create your app with default coloring and you let the operating system set your colors according to the user's theme preference OR add these in settings. I hate programmers who think their color preference should be the only one, and not just that, but also state it proudly with a "it doesn't burn your eyes".


[flagged]


Apparently you still beat a dead horse. Lemme make it clear for you, so there is no misunderstanding. I do not nor have said anywhere that I have disdain for people with disabilities.

Furthermore, coloring is an end-user business, not yours as programmer. Lemme explain this as well, since I am somehow under the assumption you are missing a full point of how modern operating systems works.

All modern operating systems have a window manager that is in charge of setting, among a lot other stuff, also the colors. They get those colors from the end-user current selected theme. If the end-user wants in his theme a memo to be red and a combobox to be black, then all the programs running on that end-user better have memos red and comboboxes black. Any one of those programs that do not let the operating system set their font, font color and background color of various components are breaking the end-user trust. And here is the amazing kicker! You, as a programmer, have to do absolutely nothing about it. All modern IDE's/compilers will do this by default.

Now, if you mess around and change that because you, as programmer, "know better" then you're a poor programmer. One way to redeem yourself is to let your users set the colors in your program under a Settings page.

Final thought. In regards to user with disabilities, they have different disabilities and different coloring needs. So this "cool kid" who thought dark mode is not burning their eyes, is the one disregarding them, not me.


This used to be the case from the nineties to the early two thousands, but theming was largely crippled in most environments by 2010.

This project is using a video game UI library, so this thread doesn't completely apply but here we are.


People like the above are full of nonsense.

I personally prefer dark mode, but it should absolutely be up to the user/OS whether a given app will run in light or dark mode.


A little stretch ... yet I needed a decompiler for Mac a while ago and used https://www.hopperapp.com/ (also recommended on the German fanboys.fm podcast). found it was doing its job quite well (with a couple of helpful features, espcially the flow control graph).

It‘s commercial though.


I like HT editor, a clone of Hiew. Simple, but fun.

http://hte.sourceforge.net/

For fancier visualizations of binaries, check out this thread:

https://reverseengineering.stackexchange.com/a/6004


Which, if I'm not mistaken, is itself a descendant of the now extinct 'biew' [0] which was very good to navigate an elf file.

[0]: https://en.wikipedia.org/wiki/Beye


Discussion on reddit (post by the developer):

https://www.reddit.com/r/ReverseEngineering/comments/k62yr6/...


Sorry, I hate dark mode apps. Too much eye strain for me. Give me a terminal screen with dark grey letters against a not quite white background and I'm good. Too many books when I was younger I guess.


I used to criticize those who use dark modes, but then after trying it I think I cannot go back again. At the end of the day, it's like when we were using monochrome screens back in the 80's/90's. I don't think anyone at that time used a screen filled with green phosphor color in the background with black characters on top. It was green/amber chars over black background.

I think that the difference in comfort when reading is that in the case of a book the light is reflected, instead of emitted, like in a monitor.

Recently I had a series of very intensive sessions with Ghidra, and jumping through hex code for hours was really hurtful, until I learn Ghidra has a dark mode (an ugly one, just colors inverted).


Nice hex editor for reverse engineers, based on ImGui. You may also like the open source NSA Ghidra codebrowser(saw Geohot using it on Youtube)


I can't get this thing to launch.

> error while loading shared libraries: libcapstone.so.4: cannot open shared object file: No such file or directory

Apt installed libcapstone, what am I missing?


did you try libcapstone-dev? Or something like that

Might require the dev libs


Yeah I picked that one up too, along with python3-capstone


Related, visualize binary files https://binvis.io/


It is too small (unusable) in my 4K screen - using 225% scaling in Windows 10


Is there an option for custom line width/bytecount?


This thread title is undergoing changes a lot of times


Cool, it’s like WireShark for files. Looks pretty too.


Is "for people that value their eye sight" just a synonym for "defaults to dark mode"?


The whole phrase is "A Hex Editor for Reverse Engineers, Programmers and people that value their eye sight when working at 3 AM."

The screenshots sure are unkind on my presbyopic eyes, even when blown up to full size.


Dark mode with green letters - a standard for hours of working before the screen since 1980’s . The white background is not good for the eyes.


Yeah, but in those days we did that because there wasn't any other option. It's not like the colour scheme of the monochrome terminal was chosen for ergonomic reasons.

If anything, amber terminals were easier on the eyes. Or the white on black ones. Those were nice.


Was going to say the same thing. It was well known at the time that amber was better, but manufacturers mostly continued pumping out green anyway.


When I go outside green is the color my eyes are looking for to relax. Also pixels in the white background emit the maximum energy. One reason Apple introduced the dark mode is the pixels to emit mostly the valuable information and save energy , thus saving the battery life.


That's not how LCDs work.


All my devices are Retina ones. Who uses LCD today?


Billions of devices shipped every year.

https://archive.is/LQFZu

BTW, "Retina" doesn't necessarily mean OLED either. It's a trademark that Apple has applied to more LCDs, as recently as the iPhone 11.

https://www.apple.com/iphone-11/specs/


Retina is about pixel density.


Amber terminals were gorgeous


not "terminal" but IMHO the best monitor that at the past I used for development was the monochrome (b/w) one for Atari ST.


And not the crisp white of modern LCD


That's why we use tunable brightness and white point like f.lux.


The white background is fine for the eyes, so long as the brightness is set properly - minimum brightness for the surrounding lighting with medium-high contrast. IME, this setup in a well lighted office makes a marked difference in eyestrain at the end of the day when compared to dark modes, dark rooms, and high-brightness light modes.


It's totally individual though. Back when we finally got terminals with white background I was very pleased. A co-worker was completely unable to use them though - he had to set the terminal to reverse mode. We talked about it and it was clear his eyesight was completely different from mine. There's no "one size fits all" here, and I for one have problems with dark mode - I see "flares".


Light changes over the day. It's impossible to leave it dialed in.


This is precisely why I use f.lux[0] on every computer. As the blue light is reduced toward evening, the screen becomes much less bright. Works great for eye comfort and is maybe even beneficial for sleep.

[0] https://justgetflux.com/


>The white background is not good for the eyes.

There is no evidence dark mode is better. In fact, human eyes don't have good night vision, we see best in daylight.

Light text on a dark background makes the eye work harder and open wider, since it needs to absorb more light. When this happens, the light letters can bleed into the dark background and cause halation. Our eyes focus better when the iris is narrow.

Additionally, most people are born with some form of astigmatism, a misshaped cornea that blurs vision. For people that have the worst forms of astigmatism, light text on dark backgrounds aggravates the condition. When looking at a light display, the iris closes more, decreasing the effect of the deformed cornea. When using a dark display the iris opens to receive more light and the deformation of the cornea makes halation worse.

On the flip side, dark mode helps with floaters, tiny fibers or spots that appear in a person's vision. These are caused by changes to the fluid in the eye which cause shadows to be cast on the retina. Floaters distort vision in light mode. This condition tends to increase with age.

Also, people with light sensitivity might be better served by a dark background.

I have found that dark mode works best in low light, 100% contrast can be harder to read with more eye strain, reading large amounts of text in dark mode is harder.

It is frustrating when people who work in IT don't take accessibility seriously. Not everybody is young and in perfect health. Both light and dark mode should be offered for accessibility reasons.


Green on black is just as much of a meme.

If you actually want easy on the eyes do what they actually did in the 80s... grey on dark blue.


>If you actually want easy on the eyes do what they actually did in the 80s... grey on dark blue.

Is AmigaOS 1.x default color scheme related to this?


I'm thinking word perfect. But I preferred Amber monochrome.


Amiga-wise, always liked the AmigaOS 2+ black on grey scheme.

But on my terminals, I do indeed prefer amber on black.


Green letters doesn't seem eye friendly at least to my eye. My eye much prefers white on dark grey for emissive screens (LCD, LED) or black on white for reflective screens (e-Ink).

I had the impression that pre-1980's screens were green for chemical reasons not for eye-strain optimization (?)


Says who?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: