C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » .NET Framework »

.Net Portable Executable File


Posted Date: 12 Oct 2006    Resource Type: Articles    Category: .NET Framework
Author: Gaurav Sharma Member Level: Diamond    
Rating: 1 out of 5Points: 8



Introduction



Microsoft .NET CLR executables are different from typical Windows executables in that they carry not only code and data, but also metadata. A Windows executable EXE or DLL file must follows the file format called PE file format, which is the darivative of Common Object File Format (COFF). Through these formats the Windows OS knows how to load and execute the EXE and DLLs .

.Net PE File is different from standard PE File . Here are the structures of both types of PE files.

Standard PE File

Layers from bottom

Layer1: Native Image Sections ( .data, .ndata, .rsrc,.text )
Layer2: Optional Header
Layer3: PE/COFF Header
Layer4: MS DOS Header


-----------------------------------------------------------------------


.Net PE file Format
From Bottom

Layer1:Native Image Sections ( .data, .ndata, .rsrc,.text )
Layer2:CLR Data ( MetaData , IL (Code) )
Layer3:CLR Header
Layer4:PE/COFF Header


As you seen in above .Net PE file includes the layers CLR Data and CLR headers to support the CLR Functionality.The CLR uses
metadata to determine how to load classes and uses the IL code to turn into native code for execution.The CLR Header mainly stores the relative virtual addresses (RVA) that holds the informations that are helpful for CLR managed execution.The CLR data portion contains metadata and IL code, both of which determine how the program will be executed.


---> dumpbin.exe is utility which dumps the content of PE File into readable text.

for example write this on command prompt

dumpbin.exe hello.exe /all  | more 


it will shows the content the PE file in page wise manner.


Here are all the options which you can use with dumpbin.exe utility


Option Descripton
---------------------------------------------------------------
/all Displays all the information from the PE File.
/exports Displays all the exports from the PE file.
/header Displays the header information from the PE File.
/clrheader Display the .NET Framework header information for an image built with /clr .
/imports Displays all imports for the PE file.
--------------------------------------------------------------------------------------------




Summary

PE File is an important file of .Net Framework , so its good to know its structure. This article is just an introduction , search on google to find more about the .Net PE File.
Thanks
Gaurav Sharma





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Three_tier architecture.
Previous Resource: Introduction to encapsulation in C# with accesssors
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use