[X-Unix] How does one find a string in a binary file, etc.?

David Ledger dledger at ivdcs.demon.co.uk
Tue Sep 2 11:18:15 PDT 2008


At 09:06 -0700 2/9/08, Aaron wrote:
>Thanks, Björn, for your quick response.
>
>>From: "B. Kuestner" <kuestner at macnews.de>
>>Date: Tue, 2 Sep 2008 15:43:00 +0200
>>
>>Try "man strings".
>
>That gets a negative result. "man string" turns up a bunch of C 
>functions. "apropos string" turns up lots and lots of C functions 
>and a few other useless items. Am I missing something?

My Leopard is also missing a man page for 'strings'. For other 
versions of strings
   strings -a file
searches the entire binary. If it thinks it's an app, only the data 
segment is searched.
   strings -t x file
shows the offset where the string is found. 'x' can be 'd' for 
decimal, 'o' for octal, 'x' for hex.

Searching with perl is another possibility.

David


-- 
David Ledger - Freelance Unix Sysadmin in the UK.
HP-UX specialist of hpUG technical user group (www.hpug.org.uk)
david.ledger at ivdcs.co.uk
www.ivdcs.co.uk


More information about the X-Unix mailing list