Reading PE files EntryPointAdress using c#

968 Views Asked by At

Is there a good way to read PE files entrypoint? I found some codes in the following line http://code.cheesydesign.com/?p=572

My code is:

PeHeaderReader reader = new PeHeaderReader("c:\\testfile.exe");
if (reader.Is32BitHeader)
{
   long EntryPoint = reader.OptionalHeader32.AddressOfEntryPoint;
}

The problem is the entrypoint is not accurate?

1

There are 1 best solutions below

0
On BEST ANSWER

I Solved the probelm by converting the EntryPoint(RVA) to FileOffest . Thanks