Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
edited tags
Link
MC68020
  • 8.6k
  • 3
  • 25
  • 52
Source Link
Mark
  • 4.7k
  • 3
  • 31
  • 44

Grep, but for binaries

I've got a fragment of an image file produced by data-recovery software. I suspect the complete original is somewhere on my home fileserver.

If this were a fragment of a text file, I could just grab a unique-looking fragment, run grep -r -l -F , and come back in a few hours for the answer. However, since this is a binary file, it's got all sorts of things that grep doesn't like (such as null bytes), and even if I can get past that, I don't know how to give grep input that isn't valid UTF-8.

How can I search for the original, preferably without writing my own search program?

(This is not a duplicate of this question: despite the likely-sounding title, that one is about finding strings in binary files, where I'm looking for binary data in binary files.)