I am trying to extract some information from a binary file. It looks like this:
AUTHCODE(here goes 3 bytes, that I don't need)part_that_i_need(here goes a NULL byte).

How to I match the portion of alpha-numeric characters qszjlbnkmctkkezgd_qyzkyptqigudilzpkp_qgetefvmigwimrihudk that is between bytes {11} {00} {38} and {00}.
Here’s what I’ve done so far:
string ReadFileMF;
using (StreamReader reader = new StreamReader(pathCopy))
{
ReadFileMF = reader.ReadToEnd();
}
///match the whole string
Match passMF = Regex.Match(ReadFileMF, @"(AUTHCODE).+?(www)");
String passMFs = passMF.Value;
//convert to array of bytes
byte[] bpass = StrToByteArray(passMFs);
//replace the 3 bytes after AUTHCODE with spaces
bpass[8] = 0x20;
bpass[9] = 0x20;
bpass[10] = 0x20;
Ok, so now I have just to match the nullbyte at the end. Somthing like (AUTHCODE).+?(NULL_BYTE). Any ideas?
This might be easiest with a few simple for-loops or Copy() actions over the byte data. Too few specs to be exact. Like:
If you do want/need Regex, you’ll have to turn it into a string first. Your only safe bet seems to be ASCII encoding.
and then (untested)