binutils "strings" like functionality?

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Thu Mar 3 17:44:08 EST 2005


In <1109858503.101635.185640 at l41g2000cwc.googlegroups.com>, cjl wrote:

> I am working on a little script that needs to pull the strings out of a
> binary file, and then manipulate them with python.
> 
> The command line utility "strings" (part of binutils) has exactly the
> functionality I need, but I was thinking about trying to implement this
> in pure python.
> 
> I did some reading on opening and reading binary files, etc., and was
> just wondering if people think this is possible, or worth my time (as a
> learning exercise), or if something like this already exists.

If you find it interesting and challenging go ahead and try it.  It is
possible and with the help of the 're' and 'mmap' modules it should be
quite easy to filter strings out of files without the need to load them
into memory at once.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list