Lister: "Search hex string" should inform of incorrect text
Posted: 2024-02-06, 17:30 UTC
Search hex string is a good option when we need to find a binary sequence in a file. However, it does not always inform about unsuccessful result. This happens when the text sample, input in the search box, cannot be properly converted to hex values, often by mistake or mistype.
For example, let open for view the file HISTORY.TXT from TC, set the hex string search mode and input the text: 0d0a32
Lister immediately finds the first line starting from symbol "2": 0d0a is CRLF (next line), 32 is hex code of "2".
Modify the search text to odoa32 (replace zero with small letter "o" in 2 places).
Lister informs that text is not found, it looks like correct result, but the sample text is not a hex sequence.
Modify the search to od0a32 (replace only first zero with "o"). Lister finds nothing and shows no error. This is definitely wrong.
Lister should check that search text can be converted to hex characters and inform about error, which will allow a user to easily fix the mistake. In particular, both odoa32 and od0a32 should result in the same error message.
For example, let open for view the file HISTORY.TXT from TC, set the hex string search mode and input the text: 0d0a32
Lister immediately finds the first line starting from symbol "2": 0d0a is CRLF (next line), 32 is hex code of "2".
Modify the search text to odoa32 (replace zero with small letter "o" in 2 places).
Lister informs that text is not found, it looks like correct result, but the sample text is not a hex sequence.
Modify the search to od0a32 (replace only first zero with "o"). Lister finds nothing and shows no error. This is definitely wrong.
Lister should check that search text can be converted to hex characters and inform about error, which will allow a user to easily fix the mistake. In particular, both odoa32 and od0a32 should result in the same error message.