[ale] Binary Grep

Greg Freemyer greg.freemyer at gmail.com
Tue Nov 16 19:18:46 EST 2004


On Tue, 16 Nov 2004 19:04:26 -0500, Geoffrey <esoteric at 3times25.net> wrote:
> Greg Freemyer wrote:
> 
> 
> > Does anyone know of a grep like tool that works for binary files?
> >
> > In particular, I have a binary file I want to find all occurrances of
> > 16 hex FF chars in a row.
> >
> > ie.    0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
> > 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF
> >
> > It would be great if it also provided some surrounding detail, but at
> > a minimum I need the offset in the file.
> >
> > Thanks
> > Greg
> 
> Man I keep getting great ideas. :)  use perl?
> 
> --
> Until later, Geoffrey
> 
Thanks, and keep 'em coming.

"grep --binary" is an option used with M$ machines that have that
TEXT/BINARY file concept.  It does not even have a meaning when you
are running with a Linux kernel.

"vi -b" - Thanks, that was new to me, and on a small sample file I
have, I could see a bunch of <ff> <ff> series.  That would be great if
I were looking at small files.  Unfortunately I'm not.

With "vi -b", do you have any idea what the search syntax would be to
find 0xff chars in the file?  I know the ^V^C trick to look for
control-C etc., but I don't know a way to look for hex. (nor octal).

perl - Sad to say, but I don't know perl.  I thought about writing a
quick C program, but I that sounds a little too difficult for the
situation.

Thanks
Greg



More information about the Ale mailing list