I am looking for certain strings in (Windows) executable files.
First I started with
grep -a string file
as that treats binary files like text files. The problem there is there is no neat output, line breaks happen by chance (when the right bytes come in order) etc.pp.
So I thought I'd use strings:
strings file | grep -i string
To my astonishment 'strings' does not find strings that I was able to find using 'grep -a'. However 'strings' is nice in the way that it outputs each item of whatever it finds on a new line.
How do I get the best of both worlds? Meaning I want to really find everything and also get sensible output of what was found.