WerWolv / ImHex

🔍 A Hex Editor for Reverse Engineers, Programmers and people who value their retinas when working at 3 AM.
https://imhex.werwolv.net
GNU General Public License v2.0
42.8k stars 1.88k forks source link

[Bug] Diffing view matches zeroes with undefined areas for Intel Hex files #1008

Open Mikaz-fr opened 1 year ago

Mikaz-fr commented 1 year ago

Operating System

Windows

What's the issue you encountered?

When comparing two intel hex files, regions that are undefined (marked with ??) are shown as matching with values 00.

See in the following screenshot: diffing_intel_hex

I believe undefined is different that zeroes and this should be shown as modified or removed.

Additionally when diffing intel hex files the same limitations with large undefined areas than with file handling applies. It would be nice to offer (undefined) regions folding or jumping over like described in #682.

How can the issue be reproduced?

Create two files as: FileA:

:0A00200000112233445566778899D9
:0A00500000112233445566778899A9
:00000001FF

FileB:

:1000100000000000000000000000000000000000E0
:100020000011223344551122334400000000000027
:1000400000000000000000000000000000000000B0
:10005000AABBCCDDEEFF00000000000000000000A5
:100060000000000000000000000000000000000090
:00000001FF

Open them as Intel Hex format and use the diffing view.

ImHex Version

1.28.0

ImHex Build Type

Installation type

Portable windows

Additional context?

No response

github-actions[bot] commented 1 month ago

This issue is marked stale as it has been open for 11 months without activity. Please try the latest ImHex version. (Avaiable here: https://imhex.download/ for release and https://imhex.download/#nightly for development version) If the issue persists on the latest version, please make a comment on this issue again

Without response, this issue will be closed in one month.

Mikaz-fr commented 1 month ago

I had a try at the issue is still present on version 1.35.4, things are even worse than originally reported ! It seems that now undefined areas are reported as 00 instead of ??, which makes them impossible to differentiate in the hex view. So in the diff view the differences with regions of 00 are still not detected, and the regions size difference is not marked anymore either. See this screenshot of exactly the same files as in the original screenshot: Screenshot 2024-08-13 100355

Reposting original screenshot (from version 1.28.0) here for simple comparison: Original screenshot

It would be really nice to see better support for Intel Hex file format in ImHex, also with the proposal from https://github.com/WerWolv/ImHex/issues/682. In any case thank you for your efforts on this tool.