A Windows executable, EXE or DLL must conform to the PE(Portable Executable) file format which is derivative of the Microsoft’ Common Object File Format(COFF). The Windows OS knows how to load and execute DLLs and EXEs because it understands the PE format. So any compiler that wants to generate windows executables must conform to the PE format.
In Standard Windows PE files we have two sections one is PE/COFF headers that reference the contents in the PE file, while the other section holds the number of native image sections, including .data, .rdata, .rsrc and .text sections. Microsoft has added a few sections to the standard PE file to provide support to the CLR. The CLR manages and understands these new sections.
As shown in the figure above, in .net PE file we have CLR headers and CLR data section in addition to the standard ones. The CLR header indicates that it is a .net executable, while CLR data holds the metadata and the IL(Intermediate language) that determine how the program needs to be executed.
This can be proved using tool dumpbin.exe
Just run “dumpbin.exe” on the command prompt followed by the executable file name with switch /all.
e.g : dumpbin.exe test.exe /all
it will illustrate the components of the PE
July 10, 2009
.Net Portable Executable File Format
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment