Buy Me a Coffee

Buy Me a Coffee!

Thursday, February 16, 2017

Reading Structured Binary files in C#: Part 9

I have added additional tests and checked them into the GitHub repository for Dissect PECOFF Binary, and there are some interesting things that I have learned.  The main thing is that each of the sections should have a starting location method.  In order to properly test, I need to be able to read the sections separately.  At times I will need to know values from previously consumed structs, so I pass those in to the method and let the method sort it out.  The next thing I noticed is that there are a ton of properties to test.  Seriously, the OptionalHeaderWindowsSpecificPE32 alone has 21.  Another thing is that this makes it really easy to spot differences between the files!  I just copy the example line and change the file name that I am testing against and any differences show up as errors.
Anyway, I have added a lot of tests, check it out.