Este artigo foi traduzido por máquina. Coloque o ponteiro do mouse sobre as frases do artigo para ver o texto original. Mais informações.
Tradução
Original
Este tópico ainda não foi avaliado como - Avalie este tópico

Metadados e a estrutura de arquivos PE

Os metadados são armazenados em uma seção de um arquivo executável portável (PE) do .NET Framework, enquanto que a Microsoft Intermediate Language (MSIL) é armazenada em outra seção do arquivo PE. The metadata portion of the file contains a series of table and heap data structures. The MSIL portion contains MSIL and metadata tokens that reference the metadata portion of the PE file. Você pode encontrar símbolos de metadados , quando você usa ferramentas como o o Desassemblador doMSIL (Ildasm. exe) para exibir o código do MSIL, por exemplo.

Each metadata table holds information about the elements of your program. For example, one metadata table describes the classes in your code, another table describes the fields, and so on. If you have ten classes in your code, the class table will have tens rows, one for each class. Metadata tables reference other tables and heaps. For example, the metadata table for classes references the table for methods.

Metadados também armazenam informações em quatro estruturas de heap : String, blob, string de usuário e GUID. All the strings used to name types and members are stored in the string heap. For example, a method table does not directly store the name of a particular method, but points to the method's name stored in the string heap.

Each row of each metadata table is uniquely identified in the MSIL portion of the PE file by a metadata token. Metadata tokens are conceptually similar to pointers, persisted in MSIL, that reference a particular metadata table.

A metadata token is a four-byte number. The top byte denotes the metadata table to which a particular token refers (method, type, and so on). The remaining three bytes specify the row in the metadata table that corresponds to the programming element being described. If you define a method in C# and compile it into a PE file, the following metadata token might exist in the MSIL portion of the PE file:

 0x06000004

The top byte (0x06) indicates that this is a MethodDef token. Os três bytes inferiores (000004) informam ao Common Language Runtime para procurar na quarta linha da MethodDef tabela para obter as informações que descrevem essa definição de método .

When a program is compiled for the common language runtime, it is converted to a PE file that consists of three parts. The following table describes the contents of each part.

PE section

Contents of PE section

PE header

The index of the PE file's main sections and the address of the entry point.

The runtime uses this information to identify the file as a PE file and to determine where execution starts when loading the program into memory.

MSIL instructions

The Microsoft intermediate language instructions (MSIL) that make up your code. Many MSIL instructions are accompanied by metadata tokens.

Metadata

Metadata tables and heaps. The runtime uses this section to record information about every type and member in your code. This section also includes custom attributes and security information.

Isso foi útil para você?
(1500 caracteres restantes)

Contribuições da comunidade

ADICIONAR
© 2013 Microsoft. Todos os direitos reservados.