Saturday, September 18, 2010

Contents of .NET Managed Module


There are 4 components in a .NET Managed Module. They are listed as:

1. PE32(Portable Executable 32 bit) or PE32+ header
2. CLR (Common Language Runtime) header
3. Metadata (Data about data)
4. IL(Intermediate Language) Code

PE file header is similar to the Common Object File Format (COFF) header. If the header uses the PE32 format, the file can run on a 32-bit or 64-bit version of Windows. If the header uses the PE32+ format, the file requires a 64-bit version of Windows to run. This header also indicates the type of file: GUI, CUI, or DLL, and contains a timestamp indicating when the file was built.

CLR header contains the version of the CLR required, the MethodDef metadata token of the managed module’s entry point Main method, and the location/size of the module’s metadata, resources, strong name, etc

Every managed module contains two types of metadata tables: tables that describe the types and members defined in your source code and tables that describe the types and members referenced by your source code.

During compilation, .NET source code is converted into the intermediate format to be known by CLR. This type of intermediate format code is termed as IL in .NET environment. At runtime, the CLR converts IL into native CPU instructions.

2 comments:

  1. All the information stated are viewable using the ildasm or any other tool. So the reverse engineering becomes easy for some one interested in our product. What is the best way to avoid patented material being displayed by any of these tools.

    ReplyDelete
  2. True Srini. But, letz see to encrypt the patented info in few weeks. By and large, ppl don't have energy to crack via disassembler.

    ReplyDelete