pavankumar varanasi
What is PE(Portable Executable)? What internally happens when compiling and executing?
By pavankumar varanasi in C# on Dec 18 2012
  • Sam Hobbs
    Mar, 2013 15

    Note that the relevant Wikipedia article says (in part) that the "PE format is a data structure that encapsulates the information necessary for the Windows OS loader to manage the wrapped executable code". I say that because it was posted previously. The Wikipedia article also says "PE is a modified version of the Unix COFF file format". The PE format originally existed for unmanaged software and still is. If the interviewer is interested in your understanding of unmanaged software and you only give an answer for managed software then you will likely not do well. So the following describes what a PE file is and how it is used for unmanaged software. For unmanaged software, PE files are created by a link editor, also called a linker (or linkage editor in the context of IBM Mainframe computers). Unmanaged compilers create object files; one object file for each compiler input file. The link editor combines (links) the contents of the object files into an executable file such as a PE file. For unmanaged software, PE files contain machine code and other data necessary for execution.

    • 0
  • Jaya Kukudkar
    Feb, 2013 24

    PE is a Portable Executable file that contains assembly manifest information. At a high level, the process of compiling and running a C# program can be illustrated as follows : 1. Compilation - Converting source code in C# language into bytecode in IL (Intermediate Language) using C# compiler. This step is usually done by the Microsoft C# compiler like the "csc" command line tool, which will actually write the bytecode in a PE (Portable Executable) file. 2. Execution - Converting bytecode in Intermediate Language into native code in machine language on-the-fly (or just-in-time) and executing the native code in a single step. This step is usually done by the Microsoft CLR (Common Language Runtime), which will be invoked when a PE file with IL bytecode is loaded into the Windows system.

    • 0
  • Upamanyu Roy Choudhury
    Feb, 2013 19

    A PE file is a Portable Executable file. PE is the name given to standard 32 bit Windows executables and defined the structure of the .exe file format. These files contain header information, resource and the raw machine code compiled from an applications souirce code. Please have a look at the following http://www.herongyang.com/C-Sharp/Intermediate-Language-Compile-and-Run-C-Sharp-Program.html http://www.codeproject.com/Articles/9019/Compiling-and-Executing-Code-at-Runtime http://msdn.microsoft.com/en-us/library/ht8ecch6(v=vs.71).aspx

    • 0
  • Udhayakumar R
    Dec, 2012 26

    The PE format is a data structure that encapsulates the information necessary for the Windows OS loader to manage the wrapped executable code

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS