Jump to content
Nytro

Microsoft Portable Executable and Common Object File Format Specification

Recommended Posts

Posted

This specification describes the structure of executable (image) files and object files under the Windows® family of operating systems. These files are referred to as Portable Executable (PE) and Common Object File Format (COFF) files, respectively.

Note: This document is provided to aid in the development of tools and applications for Windows but is not guaranteed to be a complete specification in all respects. Microsoft reserves the right to alter this document without notice.

This revision of the Microsoft Portable Executable and Common Object File Format Specification replaces Revision 6.0 of this specification.

This information applies for the following operating systems:

Windows Server® 2008

Windows Vista®

Windows Server 2003

Windows XP

Windows 2000

References and resources discussed here are listed at the end of this paper.

For the latest information, see:

Contents

1. General Concepts 5

2. Overview 6

3. File Headers 7

3.1. MS DOS Stub (Image Only) 7

3.2. Signature (Image Only) 7

3.3. COFF File Header (Object and Image) 8

3.3.1. Machine Types 8

3.3.2. Characteristics 9

3.4. Optional Header (Image Only) 10

3.4.1. Optional Header Standard Fields (Image Only) 11

3.4.2. Optional Header Windows-Specific Fields (Image Only) 12

3.4.3. Optional Header Data Directories (Image Only) 14

4. Section Table (Section Headers) 16

4.1. Section Flags 17

4.2. Grouped Sections (Object Only) 19

5. Other Contents of the File 19

5.1. Section Data 20

5.2. COFF Relocations (Object Only) 20

5.2.1. Type Indicators 21

5.3. COFF Line Numbers (Deprecated) 30

5.4. COFF Symbol Table 31

5.4.1. Symbol Name Representation 32

5.4.2. Section Number Values 32

5.4.3. Type Representation 33

5.4.4. Storage Class 34

5.5. Auxiliary Symbol Records 36

5.5.1. Auxiliary Format 1: Function Definitions 36

5.5.2. Auxiliary Format 2: .bf and .ef Symbols 37

5.5.3. Auxiliary Format 3: Weak Externals 37

5.5.4. Auxiliary Format 4: Files 38

5.5.5. Auxiliary Format 5: Section Definitions 38

5.5.6. COMDAT Sections (Object Only) 39

5.5.7. CLR Token Definition (Object Only) 40

5.6. COFF String Table 40

5.7. The Attribute Certificate Table (Image Only) 40

5.7.1. Certificate Data 42

5.8. Delay-Load Import Tables (Image Only) 43

5.8.1. The Delay-Load Directory Table 43

5.8.2. Attributes 43

5.8.3. Name 44

5.8.4. Module Handle 44

5.8.5. Delay Import Address Table 44

5.8.6. Delay Import Name Table 44

5.8.7. Delay Bound Import Address Table and Time Stamp 44

5.8.8. Delay Unload Import Address Table 44

6. Special Sections 44

6.1. The .debug Section 47

6.1.1. Debug Directory (Image Only) 47

6.1.2. Debug Type 48

6.1.3. .debug$F (Object Only) 49

6.1.4. .debug$S (Object Only) 49

6.1.5. .debug$P (Object Only) 49

6.1.6. .debug$T (Object Only) 49

6.1.7. Linker Support for Microsoft Debug Information 49

6.2. The .drectve Section (Object Only) 49

6.3. The .edata Section (Image Only) 50

6.3.1. Export Directory Table 51

6.3.2. Export Address Table 51

6.3.3. Export Name Pointer Table 52

6.3.4. Export Ordinal Table 52

6.3.5. Export Name Table 53

6.4. The .idata Section 53

6.4.1. Import Directory Table 53

6.4.2. Import Lookup Table 54

6.4.3. Hint/Name Table 54

6.4.4. Import Address Table 55

6.5. The .pdata Section 55

6.6. The .reloc Section (Image Only) 56

6.6.1. Base Relocation Block 56

6.6.2. Base Relocation Types 56

6.7. The .tls Section 57

6.7.1. The TLS Directory 58

6.7.2. TLS Callback Functions 59

6.8. The Load Configuration Structure (Image Only) 60

6.8.1. Load Configuration Directory 60

6.8.2. Load Configuration Layout 60

6.9. The .rsrc Section 61

6.9.1. Resource Directory Table 62

6.9.2. Resource Directory Entries 63

6.9.3. Resource Directory String 63

6.9.4. Resource Data Entry 63

6.10. The .cormeta Section (Object Only) 63

6.10.1. The .sxdata Section 64

7. Archive (Library) File Format 64

7.1. Archive File Signature 65

7.2. Archive Member Headers 65

7.3. First Linker Member 66

7.4. Second Linker Member 66

7.5. Longnames Member 67

8. Import Library Format 67

8.1. Import Header 68

8.2. Import Type 68

8.3. Import Name Type 69

References 69

Download:

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...