Comparison improvement: Synchronized scrolling and difference highlighting

Wishlists for new functionality and features.
rainwarrior
Posts: 4
Joined: 28 Jul 2018 19:01

Comparison improvement: Synchronized scrolling and difference highlighting

Post by rainwarrior »

Have been trying out HxD recently, and I think it's a really fantastic hex editor.

However, the comparison feature does not seem useful at all in its current form. Binary comparison is a task I do frequently and it would be great to have it integrated with a hex editor like this. I think it's very close to being extremely useful though, with only the following addition:

1. When using comparison, highlight all differing bytes in view with some colour change.

2. Skipping to next/previous should go to the next contiguous group of changed bytes, not the next byte.

Without 1 this really can't be used to quickly visually inspect differences, and without 2 scanning for the next group of differences one takes too many presses of F6 to ever get there (imagine a 1000 byte string of changed data).

I usually use a tool called VBinDiff for that task but having a comparison feature like this in a good windowed hex editor like this would be a much better replacement.


Edit: Realized F6 does the recentering for both compared files, but really when comparing groups you need to be able to move around in lock step to look, so there's maybe a little more to it:

3. scrolling or using the cursor keys should scroll both panes at the same time (and probably a coloured highlight of the currently selected byte in both panels so you can see where you are).
Maël
Site Admin
Posts: 1454
Joined: 12 Mar 2005 14:15

Re: Comparison improvement

Post by Maël »

So your feature request can be summarized to:
  • Highlight differing bytes
  • Synchronized scrolling of both windows
    • scrolling or using the cursor keys should scroll both windows at the same time
rainwarrior
Posts: 4
Joined: 28 Jul 2018 19:01

Re: Comparison improvement: Synchronized scrolling and difference highlighting

Post by rainwarrior »

Yes, though there was one more: ability to advance to the next group of different bytes rather than the next byte.
Maël
Site Admin
Posts: 1454
Joined: 12 Mar 2005 14:15

Re: Comparison improvement: Synchronized scrolling and difference highlighting

Post by Maël »

The next group of bytes means what exactly? The next difference (= inserted, deleted or changed blocks)?

I haven't seen that VBinDiff does it, but there are other tools that support resynchronizing compares. That's a lot more complex than byte wise compare, though. (NP complete problem, so you need heuristics.)
rainwarrior
Posts: 4
Joined: 28 Jul 2018 19:01

Re: Comparison improvement: Synchronized scrolling and difference highlighting

Post by rainwarrior »

Contiguous groups. If there are 100 different bytes in a row that are different, that's one group. I don't want to hit F6 100 times in a row and then finally on the 100th time have it jump across the file to the next difference, I want to get to that next difference in one step.

Yes, there's a lot of complicated stuff that diff/merge tools can do, but I was making this request because it seemed like it could have a lot more utility with hopefully relatively small feature additions.


Actually I notice that in its current form, it can be used to compare things that don't start at the same file offset, i.e. you can set the current cursor position at two different locations in the different files before pressing F6. That's maybe a useful thing, being able to manually set the starting point for the comparison. Kind of at odds with the other requested thing, i.e. synchronized scrolling. You'd have to be able to turn it off for that. ...anyway that's just an aside. Obviously there's a huge rabbit hole of diff tool stuff, I wasn't trying to request that HxD become the perfect diff tool. In my own use the side by side comparison aligned to the beginning of the file is by far the most important case, but probably everyone has different needs.
Maël
Site Admin
Posts: 1454
Joined: 12 Mar 2005 14:15

Re: Comparison improvement: Synchronized scrolling and difference highlighting

Post by Maël »

Ok, so once a byte pair that is different is found, skip over all the differences that follow immediately. If there is a new contiguous block of differences, jump to it.

In this case, you would really need to have colored/highlighted blocks to understand what you are doing/goes on, and maybe some additional info in the status bar, such as the sizes/positions of the differing blocks.

That would mean looking ahead further down the file.
vertigo
Posts: 10
Joined: 08 May 2018 19:42

Re: Comparison improvement: Synchronized scrolling and difference highlighting

Post by vertigo »

I agree 100% with this, and have been meaning to post something similar for a while. I also often do file comparisons and, as much as I love HxD, I prefer to use WinMerge whenever possible due to how it works in comparison. Unfortunately, it crashes when trying to compare files larger than ~100MB. But if I take two very similar files, say two mkv (video) files with the same content, where only the headers differ, it's near impossible to see this with HxD, since I have to press F6 and hold it forever to get through the differing content before I finally get to the identical data. Also, whenever I do this, once I get to the identical data and it sits there scanning the rest of the file, when it gets to the end it gives me a stream read error. In contrast, comparing the files in WinMerge highlights the differences, both in the raw data and in an overview bar to the side, so I can tell at a glance that the only differences are at the very beginning and the rest of the file is identical. That is immensely more useful. Another neat feature in WinMerge is the ability to create line filters, so you can tell it to ignore lines that differ if they contain certain characters/words/etc.

Another thought on this is that it would be nice if it were smart enough to recognize that even though the files are different when comparing each bit to the same number bit of the other file, they are identical between certain points when staggered. For example:

File 1: 123457890ABCDEFG
File 2: 1234567890ABCDEFG

Unless I'm mistaken, doing a comparison and hitting F6 repeatedly would go through all of that and see it all as being different, but in reality the only difference is bit 6 not being in file one, and everything after that point is identical in both. I know this would likely be very complicated, but it would be nice.
Retro
Posts: 1
Joined: 27 Jan 2019 15:45

Re: Comparison improvement: Synchronized scrolling and difference highlighting

Post by Retro »

Also concur, at least with the post title. Adding difference highlighting and synchronized scrolling as a comparison feature is the single most important improvement to make HxD usable as difference tool. Without it, you're just poking around in the dark. Human visual intuition is a powerful tool.

What I don't want is for this feature request to get bogged down by too many distinct ideas.

The contiguous groups idea is also intriguing, but I think highlight should be implemented first because highlight is more useful and is probably a prequisite for contiguous groups anyway.

Although something like a LCS compare was discussed previously in this topic, I don't think the time spent to implement it is worth the opportunity cost to work on other features, especially since heuristic comparison can be a tricky thing to get right.
Maël wrote: 31 Jul 2018 00:43 That would mean looking ahead further down the file.
Looking ahead would obviously be necessary for measuring the size of contiguous groups.

But for plain highlight and sync scrolling comparison, couldn't it just operate on the current view and reload on any new view?

This is presumably how scrolling works when normally displaying bytes, since HxD doesn't store the whole file in local memory, allowing it to operate on large files.
rainwarrior
Posts: 4
Joined: 28 Jul 2018 19:01

Re: Comparison improvement: Synchronized scrolling and difference highlighting

Post by rainwarrior »

(deleted post, sorry, didn't realize I was repeating myself)
mwerle
Posts: 2
Joined: 02 Jul 2019 05:43

Re: Comparison improvement: Synchronized scrolling and difference highlighting

Post by mwerle »

Hi, just registered on this forum primarily to request a couple of feature and found this discussion already ongoing.

My #1 request is to display the differences between the files being compared visually.


There are many MANY nuances to how comparison can be made better/more useful in a given situation, for example a "fuzz-factor" to skip one, two, X bytes in the comparison. To explain, if I have a block of 100 bytes which -mostly- differ but there's the occasional byte in the middle which matches, I'd want the -entire- block to be marked as 'different' if I enable this "fuzz-factor".

But as someone mentioned, let's not get bogged down and leave the initial request as "highlight differences" and "sync'd scrolling" - this would go a LONG way towards making this feature more useful.


PS. many thanks for an excellent hex editor!
random
Posts: 1
Joined: 12 Jun 2020 17:34

Re: Comparison improvement: Synchronized scrolling and difference highlighting

Post by random »

Hello,
I registered here to say thank you for the great editor and that synchronized scrolling and difference highlighting would be very useful for me too.
neo85
Posts: 1
Joined: 15 Dec 2020 08:31

Re: Comparison improvement: Synchronized scrolling and difference highlighting

Post by neo85 »

Yes, these features would be great.
Thx in advance.
DiHydro
Posts: 1
Joined: 05 Aug 2021 06:58

Re: Comparison improvement: Synchronized scrolling and difference highlighting

Post by DiHydro »

I just started using HxD tonight to compare two .bin files, and the ability to scroll view windows synchronously would be excellent! After that, being able to highlight differences in a user selectable color would be good also.
uzhkijhghk
Posts: 2
Joined: 01 Jun 2021 07:35

Re: Comparison improvement: Synchronized scrolling and difference highlighting

Post by uzhkijhghk »

Just want to add another +1 for these FR.
Paxtez
Posts: 8
Joined: 04 Sep 2022 04:23

Re: Comparison improvement: Synchronized scrolling and difference highlighting

Post by Paxtez »

+1

This would be very nice even without highlighting (would would be ideal) even if there key combo to go to next block of difference (Ctrl+F6/Shift+Ctrl+F6?) that would be huge. Often I'm like "Ok I expect this part to be different, take me to the next different part".
Post Reply