What is the best way to search a large binary file for a certain substring in C#?
To provide some specifics, I'm trying to extract the DWARF information from an executable, so I only care about certain parts of the binary file (namely the sections starting with the strings .debug_info
, .debug_abbrev
, etc.)
I don't see anything obvious in Stream
, FileStream
, or BinaryReader
, so it looks like I'll have to read chunks in and search through the data for the strings myself.
Is there a better way?