🌐
GNU
sourceware.org › binutils › docs › binutils › strings.html
strings (GNU Binary Utilities)
Next: strip, Previous: size, Up: Introduction [Contents][Index] · For each file given, GNU strings prints the printable character sequences that are at least 4 characters long (or the number given with the options below) and are followed by an unprintable character
🌐
Debian Manpages
manpages.debian.org › jessie › binutils › strings(1)
strings(1) — binutils — Debian jessie — Debian Manpages
Only print strings from initialized, loaded data sections in the file. This may reduce the amount of garbage in the output, but it also exposes the strings program to any security flaws that may be present in the BFD library used to scan and load sections. Strings can be configured so that this option is the default behaviour.
🌐
LinuxQuestions.org
linuxquestions.org › questions › programming-9 › 'strings'-binary-from-binutils-how-do-you-use-it-819825
'strings' binary from binutils - how do you use it?
Hi , it is about 'strings' binary from binutils. I recently wanted to test what it does and how it works. The best I did was this: Code: #!/bin/sh
🌐
Desy
www-zeuthen.desy.de › dv › documentation › unixguide › infohtml › binutils › docs › binutils › strings.html
strings - GNU Binary Utilities
Next: strip, Previous: size, Up: Top · strings [-afovV] [-min-len] [-n min-len] [--bytes=min-len] [-t radix] [--radix=radix] [-e encoding] [--encoding=encoding] [-] [--all] [--print-file-name] [-T bfdname] [--target=bfdname] [--help] [--version] file
🌐
Debian Manpages
manpages.debian.org › testing › binutils-common › strings.1.en.html
strings(1) — binutils-common — Debian testing — Debian Manpages
Only print strings from initialized, loaded data sections in the file. This may reduce the amount of garbage in the output, but it also exposes the strings program to any security flaws that may be present in the BFD library used to scan and load sections. Strings can be configured so that this option is the default behaviour.
🌐
GitHub
github.com › skyglobe › sstrings
GitHub - skyglobe/sstrings: A simpler version of GNU binutils' strings tool. · GitHub
sstrings(1) is a Simpler strings(1) ... should do: read chunks of binary data from a file or from stdin and output every sequence of 4 or more printable characters ending either with a '\0' or a '\n' to stdout....
Author   skyglobe
🌐
GNU
sourceware.org › binutils › docs-2.29 › binutils › strings.html
GNU Binary Utilities: strings
For each file given, GNU strings prints the printable character sequences that are at least 4 characters long (or the number given with the options below) and are followed by an unprintable character.
🌐
Foreachsam
foreachsam.github.io › book-util-binutils › book › content › command › strings
strings - binutils 使用筆記 - foreachsam
Usage: strings [option(s)] [file(s)] Display printable strings in [file(s)] (stdin by default) The options are: -a - --all Scan the entire file, not just the data section [default] -d --data Only scan the data sections in the file -f --print-file-name Print the name of the file before each string -n --bytes=[number] Locate & print any NUL-terminated sequence of at -<number> least [number] characters (default 4).
Find elsewhere
🌐
Debian Manpages
manpages.debian.org › buster › binutils-common › strings.1.en.html
strings(1) — binutils-common — Debian buster — Debian Manpages
March 21, 2019 - Only print strings from initialized, loaded data sections in the file. This may reduce the amount of garbage in the output, but it also exposes the strings program to any security flaws that may be present in the BFD library used to scan and load sections. Strings can be configured so that this option is the default behaviour.
🌐
Duetorun
duetorun.com › blog › 20230620 › gnu-binutils-strings
GNU Binutils - strings - ElseWhere
June 20, 2023 - For each file given, GNU strings prints the printable character sequences that are at least 4 characters long (or the number given with the options below) and are followed by an unprintable character.
🌐
OpenSUSE Manpages
manpages.opensuse.org › tumbleweed › binutils › strings(1)
strings(1) — binutils
Only print strings from initialized, loaded data sections in the file. This may reduce the amount of garbage in the output, but it also exposes the strings program to any security flaws that may be present in the BFD library used to scan and load sections. Strings can be configured so that this option is the default behaviour.
🌐
GitHub
github.com › facebookarchive › binutils › blob › master › binutils › strings.c
binutils/binutils/strings.c at master · facebookarchive/binutils
Experimental binutils branch. Contribute to facebookarchive/binutils development by creating an account on GitHub.
Author   facebookarchive
Top answer
1 of 1
3

Various versions of strings have existed. Most of them simply look for a certain number (four or more) of printable ASCII characters, and decide, without context, that it's found a human-readable "string." This appears to be the case with the supplied strings command.

GNU gstrings appears to be much smarter. I don't have gstrings installed, but it seems to be using a heuristic that is a bit smarter than merely looking for printable ASCII characters. (Some 40 years ago, in a C programming class I took, one of our assignments was to write a better version of strings. It wasn't very difficult!)

To better understand the discrepancy, I suggest you use a different utility, hexdump.

hexdump -C /bin/ls will show you the hexadecimal codes in a table for every byte in the file, with ASCII interpretations of them an the end of each row:

00000000  cf fa ed fe 07 00 00 01  03 00 00 00 02 00 00 00  |................|
00000010  13 00 00 00 10 07 00 00  85 00 20 00 00 00 00 00  |.......... .....|
00000020  19 00 00 00 48 00 00 00  5f 5f 50 41 47 45 5a 45  |....H...__PAGEZE|
00000030  52 4f 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |RO..............|
00000040  00 00 00 00 01 00 00 00  00 00 00 00 00 00 00 00  |................|
00000050  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000060  00 00 00 00 00 00 00 00  19 00 00 00 28 02 00 00  |............(...|
00000070  5f 5f 54 45 58 54 00 00  00 00 00 00 00 00 00 00  |__TEXT..........|
00000080  00 00 00 00 01 00 00 00  00 50 00 00 00 00 00 00  |.........P......|
00000090  00 00 00 00 00 00 00 00  00 50 00 00 00 00 00 00  |.........P......|

As you can see, the same "real" human-readable strings shown on the right are also in the gstrings output.

So, the simple answer is, GNU strings does a better job than the default BSD strings.

🌐
GitHub
cs107e.github.io › guides › binutils
CS107E Guide: Binary Utilities (binutils)
Prints text strings embedded in the input file. strings is useful for searching binary files, which are not readable using a text editor.
🌐
Debian Manpages
manpages.debian.org › experimental › binutils-common › strings.1.en.html
strings(1) — binutils-common — Debian experimental — Debian Manpages
Only print strings from initialized, loaded data sections in the file. This may reduce the amount of garbage in the output, but it also exposes the strings program to any security flaws that may be present in the BFD library used to scan and load sections. Strings can be configured so that this option is the default behaviour.
🌐
MIT
web.mit.edu › gnu › doc › html › binutils_8.html
The GNU Binary Utilities - strings
For each file given, GNU strings prints the printable character sequences that are at least 4 characters long (or the number given with the options below) and are followed by a NUL or newline character.
🌐
Debian Manpages
manpages.debian.org › testing › binutils-x86-64-gnu › x86_64-gnu-strings.1.en.html
x86_64-gnu-strings(1) — binutils-x86-64-gnu — Debian testing — Debian Manpages
July 5, 2023 - Only print strings from initialized, loaded data sections in the file. This may reduce the amount of garbage in the output, but it also exposes the strings program to any security flaws that may be present in the BFD library used to scan and load sections. Strings can be configured so that this option is the default behaviour.