Skip to main content
added 97 characters in body
Source Link
MC68020
  • 8.6k
  • 3
  • 25
  • 52

You could first dump the binary file using od :

I suggest using the -x optionand -w256 options in order to reduce the size of the datafile and the number of lines in order to maximize grep efficiency and necessarily the -A n option in order to remove the needless offset address, let's have :

od -x -A n -w256 yourbinary_fragment > pattern.txt

You could also make aggressive use of the -j -N and -w options or even reedit pattern.txt in order to reduce the sizenumber of the filelines to some strict minimum. (In order to significantly reduce the time needed by grepease grep's work)

Then find for the files matching the patternsfind for the files matching the patterns after being themselves dumped

find . -type f -exec sh -c '
    od -x -A n -w256 "$1" | grep -lFf pattern.txt
' sh {} \;

If using your machine for other purposes, I'd suggest to SCHED_BATCH that process.

You could first dump the binary file using od :

I suggest using the -x option in order to reduce the size of the data and necessarily the -A n option in order to remove the offset address, let's have :

od -x -A n yourbinary_fragment > pattern.txt

You could also make aggressive use of the -j -N options or even reedit pattern.txt in order to reduce the size of the file to some strict minimum. (In order to significantly reduce the time needed by grep)

Then find for the files matching the patterns after being themselves dumped

find . -type f -exec sh -c '
    od -x -A n "$1" | grep -lFf pattern.txt
' sh {} \;

If using your machine for other purposes, I'd suggest to SCHED_BATCH that process.

You could first dump the binary file using od :

I suggest using the -x and -w256 options in order to reduce the size of the file and the number of lines in order to maximize grep efficiency and necessarily the -A n option in order to remove the needless offset address, let's have :

od -x -A n -w256 yourbinary_fragment > pattern.txt

You could also make aggressive use of the -j -N and -w options or even reedit pattern.txt in order to reduce the number of lines to some strict minimum. (In order to significantly ease grep's work)

Then find for the files matching the patterns after being themselves dumped

find . -type f -exec sh -c '
    od -x -A n -w256 "$1" | grep -lFf pattern.txt
' sh {} \;

If using your machine for other purposes, I'd suggest to SCHED_BATCH that process.

Source Link
MC68020
  • 8.6k
  • 3
  • 25
  • 52

You could first dump the binary file using od :

I suggest using the -x option in order to reduce the size of the data and necessarily the -A n option in order to remove the offset address, let's have :

od -x -A n yourbinary_fragment > pattern.txt

You could also make aggressive use of the -j -N options or even reedit pattern.txt in order to reduce the size of the file to some strict minimum. (In order to significantly reduce the time needed by grep)

Then find for the files matching the patterns after being themselves dumped

find . -type f -exec sh -c '
    od -x -A n "$1" | grep -lFf pattern.txt
' sh {} \;

If using your machine for other purposes, I'd suggest to SCHED_BATCH that process.