You already posted this question at
hex file parser in c #[
^].
However, I answered a similar query yesterday so here is the code to convert it:
int i = 0;
int index = 0;
byte[] hexBytes = new byte[sourceLine.Length /2];
do
{
string hs = sourceLine.Substring(index, 2);
hexBytes[i] = (byte)int.Parse(hs, System.Globalization.NumberStyles.AllowHexSpecifier);
i++;
index += 2;
} while (index < sourceLine.Length);
Read from the file and then copy the characters you are interested in into
sourceLine
and use the above code to convert it to its original binary values.