Find Unicode text in hex edit mode

Find Unicode text in hex edit mode

6,681583
Grand MasterGrand Master
6,681583

    Dec 12, 2015#1

    Binary files like executables often contain (resource) strings encoded in Unicode with UTF-16 LE.

    But pressing Ctrl+F with having opened a binary file in UE/UES in hex edit mode results in opening a Find dialog where are only the options to either search hexadecimal for a byte array or ASCII/ANSI for a text with or without matching case and with or without using UltraEdit regular expression engine.

    I wrote a little script which makes it possible to enter a text and search for this text UTF-16 little endian encoded in hexadecimal representation in binary file.

    For more details read the large comment at top of the small script explaining how to use this script and which features it offers.

    The script is available for download on Macros & Scripts page and listed there with title Find Unicode text in hex edit mode.

    Any suggestions for further improvements of general interest are welcome.

    The line and block comments can be removed from script file by running a replace all (from top of file) searching with Perl regular expression for ^ *//.+[\r\n]+|^ */\*[\s\S]+?\*/[\r\n]+| +//.+$ and using an empty replace string. The first part in this OR expression with three arguments matches entire lines containing only a line comment, the second part matches block comments, and third part matches line comments right to code. Removal of the comments makes the usage of this script more efficient on using it often because of JavaScript interpreter has to interpret less characters and lines.
    Best regards from an UC/UE/UES for Windows user from Austria