ImHex icon indicating copy to clipboard operation
ImHex copied to clipboard

[Bug] Search in Hex editor doesn't seem to be working if you change base address

Open hiviah opened this issue 2 years ago • 0 comments

Operating System

Linux

What's the issue you encountered?

If you just load file and do "search" (Ctrl+F) in the hex editor, it works.

Once you change base address - either via Hex editor context menu "Set base address" or using #pragma base_address 0x800FF00 in pattern, it can't find any byte.

Resetting base address back to 0x0 makes search work again.

How can the issue be reproduced?

  1. Open file - I'm using for example this Cortex-M image file but it doesn't seem to depend on file
  2. Change base address to 0x800FF00 (either via context menu in Hex Editor or #pragma base_address 0x800FF00 in pattern)
  3. Search for 5A hex character (third byte from start), or any other - doesn't work
  4. Reset base address to 0x0
  5. Search for the same byte again - it works after base address reset

ImHex Version

1.24.3

ImHex Build Type

  • [ ] Nightly or built from sources

Additional context?

If you also want to test with patterns, here are patterns I'm developing - https://github.com/trezor/trezor-firmware/tree/master/legacy/imhex . The sample file goes together with t1_firmware_v1+v2.hexpat pattern (it's 2 linear structs and Cortex-M VTOR).

Possibly the base address change has also effect on disassembly, using "entire range" instead of "selection" after base address change seems to take very long (need to cancel it before it runs overly long, but without base address change is basically instantly completed).

Nevertheless, ImHex is amazing tool, thanks for that!

hiviah avatar Oct 29 '22 00:10 hiviah