没有合适的资源?快使用搜索试试~ 我知道了~
首页Windows PE格式说明V8 Microsoft Portable Executable and Common Object File Format Specification
资源详情
资源评论
资源推荐

Microsoft Portable Executable and
Common Object File Format
Specification
Revision 8.1 – February 15, 2008
Abstract
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:
http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx

Microsoft Portable Executable and Common Object File Format Specification - 2
Revision 8.1 – February 15, 2008
© 2005–2008 Microsoft Corporation. All rights reserved.
Legal Notice
Microsoft Portable Executable and Common Object File Format Specification
Microsoft Corporation
Revision 8.1
Note: This specification is provided to aid in the development of certain development tools for the
Microsoft Windows platform. However, Microsoft does not guarantee that it is a complete specification in
all respects, and cannot guarantee the accuracy of any information presented after the date of
publication. Microsoft reserves the right to alter this specification without notice.
Microsoft will grant a royalty-free license, under reasonable and non-discriminatory terms and conditions,
to any Microsoft patent claims (if any exist) that Microsoft deems necessary for the limited purpose of
implementing and complying with the required portions of this specification only in the software
development tools known as compilers, linkers, and assemblers targeting Microsoft Windows.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights
under copyright, no part of this specification may be reproduced, stored in or introduced into a retrieval
system, modified or used in a derivative work, or transmitted in any form or by any means (electronic,
mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written
permission of Microsoft.
Microsoft may have intellectual property rights covering subject matter in this specification. Except as
expressly provided in any written license agreement from Microsoft, the furnishing of this specification
does not give you any license to any intellectual property rights, and no other rights are granted by
implication, estoppel, or otherwise.
© 2005–2008 Microsoft Corporation. All rights reserved.
This specification is provided “AS IS.” Microsoft makes no representations or warranties,
express, implied, or statutory, as (1) to the information in this specification, including any
warranties of merchantability, fitness for a particular purpose, non-infringement, or title; (2) that
the contents of this specification are suitable for any purpose; nor (3) that the implementation of
such contents will not infringe any third party patents, copyrights, trademarks, or other rights.

Microsoft Portable Executable and Common Object File Format Specification - 3
Revision 8.1 – February 15, 2008
© 2005–2008 Microsoft Corporation. All rights reserved.
Microsoft will not be liable for any direct, indirect, special, incidental, or consequential damages
arising out of or relating to any use or distribution of this specification.
Microsoft, MS-DOS, Visual Studio, Visual C++, Win32, Windows, Windows NT, Windows Server, and
Windows Vista are either registered trademarks or trademarks of Microsoft Corporation in the United
States and/or other countries. Other product and company names mentioned herein may be the
trademarks of their respective owners.
The foregoing names and trademarks may not be used in any manner, including advertising or publicity
pertaining to this specification or its contents without specific, written prior permission from the respective
owners.
Document History
Date
Change
7/28/2008
Updated two URL in Reference section. Did not change date or version number.
2/15/2008
Updated section 5.7 and transferred Appendix A to “ Windows Authenticode
Portable Executable Signature Format.”
5/18/2006
Created

Microsoft Portable Executable and Common Object File Format Specification - 4
Revision 8.1 – February 15, 2008
© 2005–2008 Microsoft Corporation. All rights reserved.
Contents
1. General Concepts .................................................................................................. 1
2. Overview ................................................................................................................ 1
3. File Headers ........................................................................................................... 1
3.1. MS-DOS Stub (Image Only) ............................................................................ 1
3.2. Signature (Image Only) ................................................................................... 1
3.3. COFF File Header (Object and Image) ............................................................ 1
3.3.1. Machine Types ........................................................................................ 1
3.3.2. Characteristics ........................................................................................ 1
3.4. Optional Header (Image Only) ....................................................................... 1
3.4.1. Optional Header Standard Fields (Image Only) ...................................... 1
3.4.2. Optional Header Windows-Specific Fields (Image Only) ........................ 1
3.4.3. Optional Header Data Directories (Image Only) ..................................... 1
4. Section Table (Section Headers) ............................................................................ 1
4.1. Section Flags ................................................................................................... 1
4.2. Grouped Sections (Object Only) ..................................................................... 1
5. Other Contents of the File ..................................................................................... 1
5.1. Section Data ................................................................................................... 1
5.2. COFF Relocations (Object Only) ..................................................................... 1
5.2.1. Type Indicators ....................................................................................... 1
5.3. COFF Line Numbers (Deprecated) .................................................................. 1
5.4. COFF Symbol Table ......................................................................................... 1
5.4.1. Symbol Name Representation ................................................................ 1
5.4.2. Section Number Values........................................................................... 1
5.4.3. Type Representation ............................................................................... 1
5.4.4. Storage Class ........................................................................................... 1
5.5. Auxiliary Symbol Records ............................................................................... 1
5.5.1. Auxiliary Format 1: Function Definitions ................................................ 1
5.5.2. Auxiliary Format 2: .bf and .ef Symbols .................................................. 1
5.5.3. Auxiliary Format 3: Weak Externals ........................................................ 1
5.5.4. Auxiliary Format 4: Files.......................................................................... 1
5.5.5. Auxiliary Format 5: Section Definitions .................................................. 1
5.5.6. COMDAT Sections (Object Only) ............................................................. 1
5.5.7. CLR Token Definition (Object Only) ........................................................ 1
5.6. COFF String Table ........................................................................................... 1
5.7. The Attribute Certificate Table (Image Only) ................................................. 1

Microsoft Portable Executable and Common Object File Format Specification - 5
Revision 8.1 – February 15, 2008
© 2005–2008 Microsoft Corporation. All rights reserved.
5.7.1. Certificate Data ....................................................................................... 1
5.8. Delay-Load Import Tables (Image Only) ......................................................... 1
5.8.1. The Delay-Load Directory Table .............................................................. 1
5.8.2. Attributes ................................................................................................ 1
5.8.3. Name ....................................................................................................... 1
5.8.4. Module Handle ....................................................................................... 1
5.8.5. Delay Import Address Table .................................................................... 1
5.8.6. Delay Import Name Table ....................................................................... 1
5.8.7. Delay Bound Import Address Table and Time Stamp ............................. 1
5.8.8. Delay Unload Import Address Table ....................................................... 1
6. Special Sections ..................................................................................................... 1
6.1. The .debug Section ......................................................................................... 1
6.1.1. Debug Directory (Image Only) ................................................................ 1
6.1.2. Debug Type ............................................................................................. 1
6.1.3. .debug$F (Object Only) ........................................................................... 1
6.1.4. .debug$S (Object Only) ........................................................................... 1
6.1.5. .debug$P (Object Only) ........................................................................... 1
6.1.6. .debug$T (Object Only) ........................................................................... 1
6.1.7. Linker Support for Microsoft Debug Information ................................... 1
6.2. The .drectve Section (Object Only) ................................................................ 1
6.3. The .edata Section (Image Only) .................................................................... 1
6.3.1. Export Directory Table ............................................................................ 1
6.3.2. Export Address Table .............................................................................. 1
6.3.3. Export Name Pointer Table ..................................................................... 1
6.3.4. Export Ordinal Table ............................................................................... 1
6.3.5. Export Name Table ................................................................................. 1
6.4. The .idata Section ........................................................................................... 1
6.4.1. Import Directory Table ........................................................................... 1
6.4.2. Import Lookup Table ............................................................................... 1
6.4.3. Hint/Name Table..................................................................................... 1
6.4.4. Import Address Table.............................................................................. 1
6.5. The .pdata Section.......................................................................................... 1
6.6. The .reloc Section (Image Only) ..................................................................... 1
6.6.1. Base Relocation Block ............................................................................. 1
6.6.2. Base Relocation Types ............................................................................ 1
6.7. The .tls Section ............................................................................................... 1
剩余77页未读,继续阅读















安全验证
文档复制为VIP权益,开通VIP直接复制

评论0