LLVM-STRINGS(1)

πŸ’– LLVM-STRINGS(1) β€” the LLVM manual, bestie edition πŸ’–

Okay so this is llvm-strings(1) from the LLVM manual set, and it’s lowkey iconic for one very specific job: finding readable strings hiding inside files. Let’s get into it. 🫢

🌸 NAME 🌸

llvm-strings β€” print strings. That’s the whole vibe: it prints strings. No cap. ✨

✨ SYNOPSIS ✨

llvm-strings [options] [input...]

πŸ¦‹ DESCRIPTION πŸ¦‹

llvm-strings is a tool intended as a drop-in replacement for GNU’s strings, which looks for printable strings in files and writes them to the standard output stream. A printable string is any sequence of four (by default) or more printable ASCII characters. The end of the file, or any other byte, terminates the current sequence. πŸ’…

llvm-strings looks for strings in each input file specified. Unlike GNU strings it looks in the entire input file, regardless of file format, rather than restricting the search to certain sections of object files. If - is specified as an input, or no input is specified, the program reads from the standard input stream. πŸŒ€

πŸ“ EXAMPLE πŸ“

$ cat input.txt
bars
foo
wibble blob
$ llvm-strings input.txt
bars
wibble blob

See how foo didn’t make the cut? That’s because it’s only three characters, and the default minimum is four. It’s giving β€œalmost iconic, but not quite.” 😭

πŸ’… OPTIONS πŸ’…

  • --all, -a β€” Silently ignored. Present for GNU strings compatibility. It’s literally just there to be polite. πŸ™ˆ
  • --bytes=<length>, -n β€” Set the minimum number of printable ASCII characters required for a sequence of bytes to be considered a string. The default value is 4. ✨
  • --help, -h β€” Display a summary of command line options. Your classic β€œhelp me help you” moment. 🫢
  • --print-file-name, -f β€” Display the name of the containing file before each string. Very β€œtag your source, bestie” of it.

Example:

$ llvm-strings --print-file-name test.o test.elf
test.o: _Z5hellov
test.o: some_bss
test.o: test.cpp
test.o: main
test.elf: test.cpp
test.elf: test2.cpp
test.elf: _Z5hellov
test.elf: main
test.elf: some_bss
  • --radix=<radix>, -t β€” Display the offset within the file of each string, before the string and using the specified radix. Valid <radix> values are o, d and x for octal, decimal and hexadecimal respectively. Offset reveal era. πŸ”₯

Example:

$ llvm-strings --radix=o test.o
    1054 _Z5hellov
    1066 .rela.text
    1101 .comment
    1112 some_bss
    1123 .bss
    1130 test.cpp
    1141 main
$ llvm-strings --radix=d test.o
    556 _Z5hellov
    566 .rela.text
    577 .comment
    586 some_bss
    595 .bss
    600 test.cpp
    609 main
$ llvm-strings -t x test.o
    22c _Z5hellov
    236 .rela.text
    241 .comment
    24a some_bss
    253 .bss
    258 test.cpp
    261 main
  • --version β€” Display the version of the llvm-strings executable. Gotta know which era of the tool you’re in. πŸ‘‘
  • @<FILE> β€” Read command-line options from response file <FILE>. It’s like the options were invited in from a little file bestie. πŸŽ€

πŸ”₯ EXIT STATUS πŸ”₯

llvm-strings exits with a non-zero exit code if there is an error. Otherwise, it exits with code 0. Clean exit, clean conscience. Periodt. πŸ’–

πŸ’€ BUGS πŸ’€

To report bugs, please visit https://github.com/llvm/llvm-project/labels/tools:llvm-strings/. Don’t suffer in silence, bestie β€” file the bug. πŸ›

πŸ‘‘ AUTHOR πŸ‘‘

Maintained by the LLVM Team (https://llvm.org/). Iconic maintainer behavior, honestly. 🌟

2003-2023, LLVM Project. Respect the copyright era. πŸ’œ


Signed off with LLVM-STRINGS(1) energy, page 17, dated 2023-12-01 β€” stay stringy, bestie πŸ’–βœ¨

πŸ“¦ where this page comes from