NET Portable Executable File

A Windows executable, EXE or DLL, must conform to a file format called the PE file format, which is a derivative of the Microsoft Common Object File Format (COFF). Both of these formats are fully specified and publicly available. The Windows OS knows how to load and execute DLLs and EXEs because it understands the format of a PE file. Given this, any compiler that wants to generate Windows executables must obey the PE/COFF specification.

NET Portable Executable File:

  • Standard Windows PE files are divided into two major sections. The first section includes the PE/COFF headers that reference the contents within the PE file

  • In addition to the header section, the PE file holds a number of native image sections, including the .data, .rdata, .rsrc , and .Text sections. These are the standard sections of a typical Windows executable, but Microsoft's C/C++ compiler allows you to add your own custom sections into the PE file using a compiler pragma statement.

  • For example:
  • you can create your own data section to hold encrypted data that only you can read.

  • Taking advantage of this ability, Microsoft has added a few new sections to the normal PE file specifically to support the CLR's functionality.

  • The CLR understands and manages the new sections.

  • For example
    the CLR will read these sections and determine how to load classes and execute your code at runtime.

  • The sections that Microsoft has added to the normal PE format are the CLR header and the CLR data sections.

  • While the CLR header stores information to indicate that the PE file is a .NET executable, the CLR data section contains metadata and IL code, both of which determine how the program will be executed.

  • Comments

    No responses found. Be the first to comment...

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: