RAFIND2(1)

๐Ÿ“ฆ
version 6.2.2 ยท 4 versions
, in alpine 3.24, arch rolling, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu stonking

๐Ÿ’– rafind2 โ€” bestie's guide to hunting bytes (RAFIND2(1)) ๐Ÿ’–

okay so you found the manual for rafind2, and honestly? this little tool is a whole main character. it's an advanced command-line byte pattern search in files, and it does NOT miss. we're in section 1 of the manual, she's iconic, let's go ๐ŸŽ€


โœจ NAME โœจ

rafind2 โ€” advanced command-line byte pattern search in files ๐Ÿฆ‹


๐ŸŒธ SYNOPSIS ๐ŸŒธ

rafind2 [-mBXnzZhqv] [-a align] [-b size] [-f from] [-t to]
        [-[e|s|S] str] [-x hex] [-E] [-F file] [-g] [-i] [-I str] [-j]
        [-L] [-M str] [-R str] [-r] [-c] [-V s:num | s:num1,num2]
        -|file|dir ...

yes, that's a lot of flags. yes, you're gonna learn all of them. periods only, bestie. ๐Ÿ’…


๐Ÿ’œ DESCRIPTION ๐Ÿ’œ

A versatile utility for searching byte patterns in files, supporting alignment, offset ranges, string and hexadecimal queries, and customizable output formats. it's giving swiss army knife but make it bytes ๐Ÿ˜คโœจ

The following options are available: ๐Ÿ‘‡


โœจ OPTIONS โœจ

  • -a align โ€” Only accept aligned hits. if it ain't lined up, it ain't invited ๐Ÿ™…โ€โ™€๏ธ
  • -b size โ€” Set block size. choose how much you're chewing at a time ๐Ÿ“
  • -B โ€” Use big endian instead of little endian (See -V). big-endian girlies rise ๐ŸŒˆ
  • -c โ€” Disable colorful output (mainly for for -X). yes, "for for". we keep it exactly as written, no cap ๐Ÿ’€ also: no color today, we're being minimal
  • -e regex โ€” Search for regex matches (can be used multiple times). stack 'em, the more the merrier ๐Ÿงš
  • -E โ€” Perform a search using an esil expression. esil arc, iykyk ๐Ÿ‘‘
  • -f from โ€” Start searching from address from. we begin HERE and nowhere earlier โญ
  • -F file โ€” Read the contents of the file and use it as keyword. let the file speak for itself, periodt ๐Ÿ’–
  • -g โ€” Insert the replacement and resize the file (only with -R). careful bestie, this one actually TOUCHES your file ๐Ÿ˜ญ respect it!!!
  • -h โ€” Show help message. lost? hello? she's here ๐Ÿซถ
  • -i โ€” Identify filetype (r2 -nqcpm file). detective mode ๐Ÿ”
  • -I str โ€” Filter files by rbin info (arch/type/bits/...) before searching. vibe check on the metadata first ๐Ÿ’…
  • -j โ€” Output in JSON. for when a machine is reading, not your eyes ๐Ÿค–
  • -L โ€” List all IO plugins (same as r2 for now). window shopping, but plugins ๐Ÿ›๏ธ
  • -m โ€” Magic search, file-type carver. very mysterious of her ๐Ÿ”ฎ
  • -M str โ€” Set a binary mask to be applied on keywords. shape the keyword, don't change it ๐ŸŒธ
  • -R str โ€” Replace each hit with the given string (prefix with h: hex, w: wide, s: string). glow-up your bytes โœจ
  • -n โ€” Do not stop on read errors. nothing can kill her momentum ๐Ÿ”ฅ
  • -r โ€” Print using radare commands. output that r2 can literally eat ๐Ÿฝ๏ธ
  • -s str โ€” Search for a string (more than one string can be passed). the classic. the blueprint ๐Ÿ’–
  • -S str โ€” Search for a wide string (more than one string can be passed). extra wide, extra slay ๐ŸŒˆ
  • -t to โ€” Stop search at address to. we end HERE, no further โ›”
  • -q โ€” Quiet mode: fewer output do not show headings or filenames. she's being quiet, okay? shhh ๐Ÿ™ˆ
  • -v โ€” Show version information. who is she? ๐ŸŽ€
  • -V s:num | s:num1,num2 โ€” Search for a value or range in the specified endian (-V 4:123 or -V 4:100,200). numbers, but with range and endian drama ๐Ÿ‘‘
  • -x hex โ€” Search for hexpair string (909090) with optional nibble mask using dots (41.42) (can be used multiple times). raw hex hunting ๐ŸŒธ
  • -X โ€” Show hexdump of search results. the receipts, rendered pretty ๐Ÿ’…
  • -z โ€” Search for zero-terminated strings. the classic C-string look โœจ
  • -Z โ€” Show string found on each search hit. every hit gets a lil speech bubble ๐Ÿ’ฌ

๐ŸŒˆ ENVIRONMENT ๐ŸŒˆ

rafind2 does not use any environment variables. literally zero. she is self-sufficient, she needs NO external validation ๐Ÿ’…โœจ


๐Ÿ’– 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

Search for hex pattern with nibble mask (dot masks single nibble):

$ rafind2 -x "41.42" file.bin

Identify the file type:

$ rafind2 -i binary_file

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

$ rafind2 -V 4:123 file.bin

Search for a range of values (100-200) in a 4-byte word:

$ rafind2 -V 4:100,200 file.bin

Search for zero-terminated strings and show each string found:

$ rafind2 -zZ file.bin

Search using regex pattern:

$ rafind2 -e "password|passwd" file.txt

Show hexdump of search results:

$ rafind2 -X -s "hello" file.bin

Replace string hits in a file:

$ rafind2 -s "old" -R "new" file.bin

๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

radare2(1) โ€” her big sibling, go say hi ๐Ÿซถ


๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

pancake <pancake@nopcode.org>


and that's the whole page, bestie ๐Ÿ’– RAFIND2(1) โ€” from section 1 of the manual, dated Feb 4, 2026. go search some bytes, you absolute superstar โญ

๐Ÿ“ฆ where this page comes from