PDA

View Full Version : ASCII String Dump?




ArtOfWarfare
Aug 22, 2013, 10:34 AM
I'd like a utility that acts kind of like

hexdump -c

But instead of mixing in the ASCII with everything else, I'd like it to only print the ASCII.

It could have a bit of intelligence, only considering something to be ASCII if it's part of a sequence that contains at least two alphanumeric ASCII characters.

Then I would like it to insert line breaks between each sequence when it outputs it.

I'd like this utility so that I can easily find all the ASCII strings any file contains (specially, I'd like to see what strings a .mpg contains and what a .dll contains - I'm trying to find a way of determining what codecs the .dll file recognizes, and I'm hoping that it involves some ASCII strings.)



chown33
Aug 22, 2013, 10:56 AM
man strings

ArtOfWarfare
Aug 22, 2013, 03:31 PM
man strings

Thanks. I had worked out an algorithm and started writing it in C but stopped when I saw your post. Interestingly, it looks like the algorithm they used produced the exact same results as mine (or at least my algorithm wouldn't have removed anything there's didn't.)

I was assigning point values to characters. Symbols got 1 and alphanumeric got 2... everything else got 0. Contiguous sections of symbols and alphanumeric that added up to at least 4 would get printed, and a line break would be entered when it swapped from printing to not printing.

But it looks like I need not implement it because someone else already did. Thanks!