
Anyways...
I have long streams of bytes I’m working with. In those streams, PE files are embedded inside. I can identify the PE file and am parsing/validating headers etc... So far, I'm only’ up to the optional headers, which might be the problem leading to this question, but...
Question is:
How can I calculate where the end of the PE file is in the stream of bytes?
The SizeOfImage characteristic rarely seems to match the actual size of the file in bytes, so I’m guessing there’s some kind of trickery and magic I need to do with other values to find the actual end of file.
Thank you in advance for any help!!!