LLVM-STRINGS(1)

πŸ“¦
version 16.0.6 Β· 3 versions
, in ubuntu noble

✨ LLVM-STRINGS(1) ✨

okay so bestie, we're in section 1 of the LLVM manual, and today's main character is llvm-strings πŸŽ€


πŸ’– NAME πŸ’–

llvm-strings β€” print strings πŸ¦‹


🌸 SYNOPSIS 🌸

llvm-strings [options] [input…]

✨ DESCRIPTION ✨

so llvm-strings is literally a drop-in replacement for GNU's strings πŸ‘‘ it goes looking for printable strings in files and writes them straight to the standard output stream. and what counts as a printable string? any sequence of four (by default) or more printable ASCII characters. the end of the file, or literally any other byte, terminates the current sequence. periodt. πŸ’…

llvm-strings hunts for strings in each input file you specify. but here's the tea β€” unlike GNU strings, it looks in the entire input file, no matter what the file format is, instead of restricting the search to certain sections of object files. no cap. πŸ”₯

and if you pass - as an input, or you just don't specify any input at all, the program reads from the standard input stream. easy. 🫢


πŸ“ EXAMPLE πŸ“

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

(yeah it ate that up, foo was too short to make the cut 😭)


πŸ’… OPTIONS πŸ’…

  • --all, -a β€” silently ignored. it's just there for GNU strings compatibility. it's giving "present but not participating" πŸ™ˆ
  • --bytes=<length>, -n β€” sets the minimum number of printable ASCII characters a sequence of bytes needs before it counts as a string. the default value is 4.
  • --help, -h β€” shows you a summary of the command line options. your lil cheat sheet ✨
  • --print-file-name, -f β€” displays the name of the containing file before each string. iconic behaviour tbh.

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 β€” displays the offset within the file of each string, before the string, using the radix you specified. valid <radix> values are o, d and x for octal, decimal and hexadecimal respectively. pick your fighter 🌈

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 β€” displays the version of the llvm-strings executable. πŸ’œ
  • @<FILE> β€” reads command-line options from the response file <FILE>. yes bestie, options-from-a-file, we love a delegation moment 🧚

πŸ”₯ EXIT STATUS πŸ”₯

llvm-strings exits with a non-zero exit code if there's an error. otherwise? it exits with code 0. slay. ✨


😭 BUGS 😭

to report bugs, please visit <‐ https://github.com/llvm/llvm-project/labels/tools:llvm-strings/. (yes the URL is doing the most, that's just how it is πŸ’€)


πŸ‘‘ AUTHOR πŸ‘‘

maintained by the LLVM Team (https://llvm.org/). absolute legends.


2003-2024, LLVM Project


and that's the whole page bestie, you're so welcome πŸ’– this was version 15, dated 2024-04-14 β€” go forth and find those strings, iykyk πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from