Introduction to meta data and IL

Source: Internet
Author: User
Tags definition reference types of tables

1.3.2 Meta data

Metadata is the data that describes the data. In the context of the CLR, the metadata represents a set of systems consisting of descriptors that include all the items declared or referenced in a module. Because the CLR model is object-oriented, the items described in metadata are classes and their members, along with the attributes, attributes, and associations that accompany them. This section briefly introduces metadata, and content related to the security of the original data will continue to be explained in subsequent chapters, and the details of the metadata are beyond the scope of this book.

The metadata is actually a binary data containing three types of tables: the definition table, the reference table, and the manifest table.

A Metadata definition table is primarily a collection of definition tables for module definitions, type definitions, method definitions, field definitions, event definitions, parameter definitions, property definitions, and so on. When the compiler compiles the code, all defined content generates the corresponding definition table.

The Metadata reference table is used to record the type, method, field, and event of the source code reference in the compiler. Common reference tables such as: AssemblyRef (assembly reference table), ModuleRef (module reference table), TYPEREF (type reference table), and so on.

The Metadata list table contains all the information needed to make up an assembly, along with reference information for other assemblies. It clearly identifies which entries can be opened to the outside and which entries can be accessed only within the assembly.

The following is a brief analysis of the meta data information in the classic HelloWorld program, as shown in Listing 1-7.

Code Listings 1-7 HelloWorld program code

Using System;
   
Using System.Collections.Generic;
   
Using System.Linq;
   
Using System.Text;
   
    
   
Namespace HelloWorld
   
{
   
    class program
   
    {
   
        static void Main (string[] args)
   
        {
   
            Console.WriteLine ("Hello world!");
   
            Console.read ();}}
   

Below, use the Disassembly tool ildasm to open HelloWorld.exe, double-click Manifest, figure 1-7 to see a screenshot of the listing information. ILDasm use methods and parameter descriptions please refer to the MSDN documentation.

Figure 1-7 View program manifest information

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.