Reputation: 373
When compiling visual studio c# applications PE and EXE files will generate. So what main difference between PE and EXE file? As i know PE file contains
PE/COFF Headers,
CLR Headers,
CLR Data,
Meta Data,
IL code,
.data,.text...
than what exe contains?.How PE differ from EXE?
Upvotes: 5
Views: 7369
Reputation: 28074
.exe files are a subset of PE files, while PE files include .exe, .dll and .ocx files.
Upvotes: 3
Reputation: 4681
So, PE
stands for Portable Executable which is the file format for executable binaries in Windows 32bits and 64bits environments.
In my understanding, the information inside the generated PE
file would consist in:
However, the IL Code would be inside the EXE
file, since it is supposed to be platform independent and it will be compiled to native code when you run the application (Just-in time-compiler
). The PE
section is also in charge of the initialisation of the CLR.
Keep in mind the PE
section can be inside the executable file, which make more sense in most applications.
Upvotes: 2
Reputation: 26281
Portable Executables (PE) are files that contain all the necessary information for the operating system to correctly load executable code (.exe, .dll, ...)
This may include dynamic library references for linking, resource management, TLS data, among other things.
Executables (.exe), however, are the files that denote the main execution point on a computer program, that is, speaking in C# terms, the file that contains the Main function or entry point.
Upvotes: 8