[X-Unix] How does one find a string in a binary file, etc.?
Eric F Crist
ecrist at secure-computing.net
Tue Sep 2 09:56:30 PDT 2008
you should be able to run 'strings <binary>' where <binary> is the
name of the binary file you want to search.
HTH
On Sep 2, 2008, at 11:06 AM, 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?
>
>> If that doesn't solve your problem, you might want to ask the group
>> again exactly which part you're missing, and we might find answers to
>> these follow-up questions.
>>
>> Regards,
>> Björn
>
> Regardless of whether I need them to solve my current problem or
> not, I would like to know how to do the following without
> programming in anything more complicated than a shell or awk or sed:
>
> 1) Search a binary file to see if it contains a certain string.
>
> 2) Read a file one (possibly arbitrary-length) block at a time and
> process that block before going on to the next, as one can easily do
> in a language like C.
>
> But, I think I'll be able to solve the problem I'm working on in
> other ways. One way is by doing nested splits so as to wind up with
> 4-KB files without having enormous numbers of such files around at
> any one time. I would then use 'cmp -n' to compare each 4-KB file to
> a smaller file containing the common start of each of the files I'm
> looking for.
>
> - Aaron
> _______________________________________________
> X-Unix mailing list
> X-Unix at listserver.themacintoshguy.com
> http://listserver.themacintoshguy.com/mailman/listinfo/x-unix
---
Eric Crist
More information about the X-Unix
mailing list