Search A File For All Printable Characters

toggle-button

Sometimes when you're working on your PC, attempting to tidy up your files, you'll come across a non-document file whose purpose is unknown to you.  Maybe it's a DLL file, or an executable EXE file, or a document created in a program which you don't have a copy of.  In a search for clues as to what this file does, and whether it might be either useful or suspicious, you load it into a text editor such as NotePad, only to find that most of the characters in it are unreadable, unpronouncable rubbish.  Sensible alphabetical characters do appear, but they're scattered among the rest of the garbage, making it difficult to decipher.

If you were doing such an exercise under Unix or Linux, you'd be in luck.  There are commands such as "strings" or "tr" that will allow you to filter out all of the rubbish in a file, leaving only the printable characters.  Sadly, no such facility exists in Windows; at least, not as standard.  But thankfully, such a program does exist.  

It's called Strings, and is written by well-known Windows guru Mark Russinovich.  It's a small, free command-line program which is simple to use.  From a command prompt, just type strings followed by the name of the file to analyze.  The strings from the file will be displayed on the screen.  To send the results to a text file instead, use the standard redirection facility.  For example, to analyze myfile.dll and send the results to printables.txt, type:

strings myfile.dll > printables.txt

You can download Strings from http://technet.microsoft.com/en-us/sysinternals/bb897439.aspx and it should work on all recent versions of Windows.  It's a tiny 0.05 MB download, and is malware-free according to VirusTotal and Web of Trust.

 

 

Please rate this article: 

Your rating: None
4.1
Average: 4.1 (10 votes)
toggle-button

Comments

Here's a smaller (0.035 MB) GUI program for the same "Binary to Text" output:

McAfee Free Tools ... under "Forensic Tools" -- here:

http://www.mcafee.com/us/downloads/free-tools/index.aspx

The download page:

BinText 3.03 - Finds Ascii, Unicode and Resource strings in a file.

http://www.mcafee.com/us/downloads/free-tools/bintext.aspx

... Quote:

" A small, very fast and powerful text extractor that will be of particular interest to programmers. It can extract text from any kind of file and includes the ability to find plain ASCII text, Unicode (double byte ANSI) text and Resource strings, providing useful information for each item in the optional "advanced" view mode. Its comprehensive filtering helps prevent unwanted text being listed. The gathered list can be searched and saved to a separate file as either a plain text file or in informative tabular format. Useful tip: Place a shortcut to Bintext in your Windows\SendTo folder ...."

It's portable. Click on the Help tab...

JD

I can see how this might be useful, but when it comes to figuring out what an unknown file is supposed to be, I would suggest TrID, which will analyze a file and report what its data type is likely to be.
http://mark0.net/soft-trid-e.html

Compressed data isn't too likely to have readable strings, after all.