peeking whats inside the binaries
January 22nd, 2007 mysurface Posted in Developer, Misc, strings | Hits: 47198 | 1 Comment »
Curiosity kills the cat, we always wants to know more. I discover a command that can actually extract and prints out the readable string from the binaries. Okay lets see what is the interesting readable string in the /bin/cat
The simplest way is doing this:
strings /bin/cat
What I get ?
...
Richard M. Stallman
Torbjorn Granlund
5.96
GNU coreutils
benstuvAET
standard output
...
Haha, that is actually plain text to showing cat’s version when you type this
cat --version
Oh, do you want to know more? By default, strings scan over the initialized and loaded sections of object files. To scan over entire files, -a.
strings -a /bin/cat
Of course you can’t get much information from cat, this command’s symbol should be already striped. But if you try on other program binaries, such as the one that you compile from source. You can obtain info such as variable names.
Where are the readable string located?
strings -t x /bin/cat
-t x prints the offset of the string in hex code, for decimal:
strings -t d /bin/cat
Just print the readable strings only if it is more than 40 characters.
strings -n 40 /bin/cat
Okay, pity cat, you may go. Huh still curious about what strings can do?
man strings







February 14th, 2007 at 7:52 am
For Debian-based distro,
stringsis available under binutils package.