I have a binary file that I'd like to open, read and understand; but I've never tried to work with binary information before.
Various questions (including Using structs in C# to read data and How to read a binary file using c#?) helped me to open and read the file, but I have no idea how to interpret the information I've so far extracted.
One approach I got some hopeful data out of was this:
using (BinaryReader reader = new BinaryReader(File.Open(filename, FileMode.Open, FileAccess.Read)))
{
for (int i = 0; i < 100; i++)
{
iValue = reader.ReadInt32();
sb.AppendFormat("{1}={2}{0}", Environment.NewLine, i, iValue);
}
}
Returns something like this:
0=374014592
1=671183229
2=558694987
3=-1018526206
4=1414798970
5=650
6=4718677
7=44
8=0
9=7077888
10=7864460
But this isn't what I was expecting, nor do I even know what it means - have i successfully determined the file contains a bunch of numbers or am I looking at an interpretation of the data (similar to how using the wrong/different encodings will return different characters for the same input).
Do I have any hope or should I stop entirely?