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
37.42k stars 1.64k forks source link

[Bug] Search backward never finished in some file #1734

Closed yyjdelete closed 3 weeks ago

yyjdelete commented 3 weeks ago

Operating System

Windows

What's the issue you encountered?

  1. Search backward will never finished in some file
  2. and you can't cancel the task or quit imhex without kill the whole process.

How can the issue be reproduced?

  1. Open imhex-gui.exe
  2. Move to end of the file
  3. Try search 637878 in hex(or cxx in utf8) backward

Search forward works well.

ImHex Version

v1.34.0

ImHex Build Type

Installation type

Portable

Additional context?

The last working version is v1.32.2

System Language: Chinese(zh_CN), encoding=gb2312(cp936), if it's an system encoding related problem. image

yyjdelete commented 3 weeks ago

Still see another infinite loop after https://github.com/WerWolv/libwolv/pull/26, seems something is out of sync, and it does search out of the file range

  1. Create an new file(length=1);
  2. Search anything forward, and reach the end(No more results);
  3. Edit->Resize, and resize it to length=0x0
  4. Search forward again and infinite loop;
WerWolv commented 3 weeks ago

Thanks a lot for the PR and the investigation! I'll take a look at the new infinite loop you've discovered