read the contents of a binary file ? or any non-text file ?

Wanted to know what’s the content of a binary file you are provided with ?

It’s not a big deal…
“strings” prints the printable characters in any given file.

“strings” is mainly useful for determining the contents of non-text files.

Here’s a sample taken for the subversion binary . . .

prabhugnanasundar@prabhugnanasundar:~$ strings svnbinaries/svn27-09/bin/svn

/lib/ld-linux.so.2
#t2CE
St2~V
libsvn_client-1.so.0
apr_hash_get
svn_string_ncreate
svn_hash_from_cstring_keys
svn_hash_keys
svn_string_create
svn_opt_parse_path
svn_diff_file_options_parse
svn_dirent_split
svn_error__locate
__gmon_start__
_Jv_RegisterClasses
svn_wc_get_actual_target2
svn_io_check_path
svn_error_createf
svn_io_remove_file2
svn_path_url_add_component2
svn_dirent_is_child
svn_string_create_from_buf
svn_config_get
svn_wc_read_kind
apr_hash_next
apr_array_push
svn_io_open_uniquely_named
svn_cstring_split
svn_io_temp_dir
svn_diff_file_output_unified3

NOTE: the above sample is just a part of the output.

This is really very handy for the admins, helping them to dig out what is in a binary which they are about to install. This helps them to get a more clear context.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s