How to search a ~500Gb file for a series of hex values and output the results to a text file?

Hi,

I'm a bit new to using Macs, and I'm trying to do something that I'd normally do in powershell.

I have a series of hex values that I wish to search for in a particularly large binary file.

For each result I would like:

  • The location of the result in the file

  • The surrounding data represented as both hex and string

I guess sort of like what you'd see if you searched for a hex value in "Hex Fiend" but I need to put it into a script as there are around ~500 values I need to search for.

It was suggested that I try Grep, but it's only returning the location of the result and I need to see (at a glance) what is in the location rather than navigating manually to each result location.

Any ideas? :)

How to search a ~500Gb file for a series of hex values and output the results to a text file?
 
 
Q