When I run my program the code below comes up with an error:
///////////////////////////// Read in the selected //////////////
BinaryReader br2 = new BinaryReader(File.OpenRead(directoryToSearch2),
System.Text.Encoding.BigEndianUnicode);
var Hexbytes = new List<string>();
///////////////////////////// Read in offset ////////////////
for (int a = 0x12 ; a <= 0x26; a++)
{
br.BaseStream.Position = a;
Hexbytes.Add(br.ReadByte().ToString("X2"));
}
The main line the debugger doesn't like is this br.BaseStream.Position = a;
.
It states that "NullReferenceException was unhandled" and "Object reference not set to an instance of an object."
Any ideas what is going wrong?