logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

rafind2 — advanced command-line byte pattern search in files

Authors

       pancake <pancake@nopcode.org>

                                                  Mar 16, 2024                                        RAFIND2(1)

Description

rafind2 is a versatile program designed to find byte patterns in files.

       The following options are available:

       -aalign    Only accept aligned search results.

       -bsize     Define the block size for searching. Depending on the cpu cache, memory and storage different
                   sizes may affect the performance.

       -c          Disable colorful output, primarily useful for non-interactive or batch use-cases.

       -eregex    Search for matches using regular expressions. Multiple expressions can be provided.

       -ffrom     Specify the starting address for the search. (See -t)

       -Ffile     Read keywords from the specified file for searching.

       -h          Display the help message.

       -i          Identify the filetype using similar techniques as the 'file' command.

       -j          Output results in JSON format.

       -L          List all available I/O plugins.

       -m          Perform magic search to identify file types based on signatures.

       -Mmask     Apply a binary mask to the keywords before searching.

       -n          Continue searching even if read errors occur.

       -q          Quiet mode: suppress headings or filenames in the output.

       -r          Print results using radare commands.

       -sstr      Search for the specified string(s) in the file(s).

       -Sstr      Search for wide strings (Unicode) in the file(s).

       -tto       Specify the ending address for the search. (See -f)

       -v          Display the version of rafind2 and exit.

       -Vs:num | s:num1,num2
                   Search  for  the  given  value  using little-endian notation. A single value can be specified
                   (e.g., -V 4:123) or a range of values can be searched by providing two values separated by  a
                   comma (e.g., -V 4:100,200).

       -xhex      Search for the specified hex pattern(s) in the file(s).

       -X          Display the hexdump of search results.

       -z          Search for zero-terminated strings.

       -Z          Display strings found on each search hit.

Examples

       Search for a specific string in a file:

             $ rafind2 -s "search_string" file.txt

       Search for a hex pattern in all the files from directory:

             $ rafind2 -x "909090" directory_path

       Identify the file type using the magic database:

             $ rafind2 -i binary_file

       Search for the little endian 123 stored in a 4 byte word inside a file:

             $ rafind2 -V 4:123 file.bin

Name

       rafind2 — advanced command-line byte pattern search in files

See Also

radare2(1)

Synopsis

rafind2  [-aalign] [-bsize] [-c] [-eregex] [-ffrom] [-Ffile] [-h] [-i] [-j] [-L] [-m] [-Mmask] [-n]
               [-q] [-r] [-sstr] [-Sstr] [-tto] [-v] [-Vs:num  |  s:num1,num2]  [-xhex]  [-X]  [-z]  [-Z]
               file|dir..

Www

       https://www.radare.org/

See Also