summaryrefslogtreecommitdiff
path: root/devdocs/go/debug%2Fpe%2Findex.html
blob: 5df3a6676147a6f548654f19e7cca28001787ad9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
<h1> Package pe  </h1>     <ul id="short-nav">
<li><code>import "debug/pe"</code></li>
<li><a href="#pkg-overview" class="overviewLink">Overview</a></li>
<li><a href="#pkg-index" class="indexLink">Index</a></li>
</ul>     <h2 id="pkg-overview">Overview </h2> <p>Package pe implements access to PE (Microsoft Windows Portable Executable) files. </p>
<h3 id="hdr-Security">Security</h3> <p>This package is not designed to be hardened against adversarial inputs, and is outside the scope of <a href="https://go.dev/security/policy">https://go.dev/security/policy</a>. In particular, only basic validation is done when parsing object files. As such, care should be taken when parsing untrusted inputs, as parsing malformed files may consume significant resources, or cause panics. </p>     <h2 id="pkg-index">Index </h2>  <ul id="manual-nav">
<li><a href="#pkg-constants">Constants</a></li>
<li><a href="#COFFSymbol">type COFFSymbol</a></li>
<li> <a href="#COFFSymbol.FullName">func (sym *COFFSymbol) FullName(st StringTable) (string, error)</a>
</li>
<li><a href="#COFFSymbolAuxFormat5">type COFFSymbolAuxFormat5</a></li>
<li><a href="#DataDirectory">type DataDirectory</a></li>
<li><a href="#File">type File</a></li>
<li> <a href="#NewFile">func NewFile(r io.ReaderAt) (*File, error)</a>
</li>
<li> <a href="#Open">func Open(name string) (*File, error)</a>
</li>
<li> <a href="#File.COFFSymbolReadSectionDefAux">func (f *File) COFFSymbolReadSectionDefAux(idx int) (*COFFSymbolAuxFormat5, error)</a>
</li>
<li> <a href="#File.Close">func (f *File) Close() error</a>
</li>
<li> <a href="#File.DWARF">func (f *File) DWARF() (*dwarf.Data, error)</a>
</li>
<li> <a href="#File.ImportedLibraries">func (f *File) ImportedLibraries() ([]string, error)</a>
</li>
<li> <a href="#File.ImportedSymbols">func (f *File) ImportedSymbols() ([]string, error)</a>
</li>
<li> <a href="#File.Section">func (f *File) Section(name string) *Section</a>
</li>
<li><a href="#FileHeader">type FileHeader</a></li>
<li><a href="#FormatError">type FormatError</a></li>
<li> <a href="#FormatError.Error">func (e *FormatError) Error() string</a>
</li>
<li><a href="#ImportDirectory">type ImportDirectory</a></li>
<li><a href="#OptionalHeader32">type OptionalHeader32</a></li>
<li><a href="#OptionalHeader64">type OptionalHeader64</a></li>
<li><a href="#Reloc">type Reloc</a></li>
<li><a href="#Section">type Section</a></li>
<li> <a href="#Section.Data">func (s *Section) Data() ([]byte, error)</a>
</li>
<li> <a href="#Section.Open">func (s *Section) Open() io.ReadSeeker</a>
</li>
<li><a href="#SectionHeader">type SectionHeader</a></li>
<li><a href="#SectionHeader32">type SectionHeader32</a></li>
<li><a href="#StringTable">type StringTable</a></li>
<li> <a href="#StringTable.String">func (st StringTable) String(start uint32) (string, error)</a>
</li>
<li><a href="#Symbol">type Symbol</a></li>
</ul> <h3>Package files</h3> <p>  <span>file.go</span> <span>pe.go</span> <span>section.go</span> <span>string.go</span> <span>symbol.go</span>  </p>   <h2 id="pkg-constants">Constants</h2> <pre data-language="go">const (
    IMAGE_FILE_MACHINE_UNKNOWN     = 0x0
    IMAGE_FILE_MACHINE_AM33        = 0x1d3
    IMAGE_FILE_MACHINE_AMD64       = 0x8664
    IMAGE_FILE_MACHINE_ARM         = 0x1c0
    IMAGE_FILE_MACHINE_ARMNT       = 0x1c4
    IMAGE_FILE_MACHINE_ARM64       = 0xaa64
    IMAGE_FILE_MACHINE_EBC         = 0xebc
    IMAGE_FILE_MACHINE_I386        = 0x14c
    IMAGE_FILE_MACHINE_IA64        = 0x200
    IMAGE_FILE_MACHINE_LOONGARCH32 = 0x6232
    IMAGE_FILE_MACHINE_LOONGARCH64 = 0x6264
    IMAGE_FILE_MACHINE_M32R        = 0x9041
    IMAGE_FILE_MACHINE_MIPS16      = 0x266
    IMAGE_FILE_MACHINE_MIPSFPU     = 0x366
    IMAGE_FILE_MACHINE_MIPSFPU16   = 0x466
    IMAGE_FILE_MACHINE_POWERPC     = 0x1f0
    IMAGE_FILE_MACHINE_POWERPCFP   = 0x1f1
    IMAGE_FILE_MACHINE_R4000       = 0x166
    IMAGE_FILE_MACHINE_SH3         = 0x1a2
    IMAGE_FILE_MACHINE_SH3DSP      = 0x1a3
    IMAGE_FILE_MACHINE_SH4         = 0x1a6
    IMAGE_FILE_MACHINE_SH5         = 0x1a8
    IMAGE_FILE_MACHINE_THUMB       = 0x1c2
    IMAGE_FILE_MACHINE_WCEMIPSV2   = 0x169
    IMAGE_FILE_MACHINE_RISCV32     = 0x5032
    IMAGE_FILE_MACHINE_RISCV64     = 0x5064
    IMAGE_FILE_MACHINE_RISCV128    = 0x5128
)</pre> <p>IMAGE_DIRECTORY_ENTRY constants </p>
<pre data-language="go">const (
    IMAGE_DIRECTORY_ENTRY_EXPORT         = 0
    IMAGE_DIRECTORY_ENTRY_IMPORT         = 1
    IMAGE_DIRECTORY_ENTRY_RESOURCE       = 2
    IMAGE_DIRECTORY_ENTRY_EXCEPTION      = 3
    IMAGE_DIRECTORY_ENTRY_SECURITY       = 4
    IMAGE_DIRECTORY_ENTRY_BASERELOC      = 5
    IMAGE_DIRECTORY_ENTRY_DEBUG          = 6
    IMAGE_DIRECTORY_ENTRY_ARCHITECTURE   = 7
    IMAGE_DIRECTORY_ENTRY_GLOBALPTR      = 8
    IMAGE_DIRECTORY_ENTRY_TLS            = 9
    IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG    = 10
    IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT   = 11
    IMAGE_DIRECTORY_ENTRY_IAT            = 12
    IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT   = 13
    IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR = 14
)</pre> <p>Values of IMAGE_FILE_HEADER.Characteristics. These can be combined together. </p>
<pre data-language="go">const (
    IMAGE_FILE_RELOCS_STRIPPED         = 0x0001
    IMAGE_FILE_EXECUTABLE_IMAGE        = 0x0002
    IMAGE_FILE_LINE_NUMS_STRIPPED      = 0x0004
    IMAGE_FILE_LOCAL_SYMS_STRIPPED     = 0x0008
    IMAGE_FILE_AGGRESIVE_WS_TRIM       = 0x0010
    IMAGE_FILE_LARGE_ADDRESS_AWARE     = 0x0020
    IMAGE_FILE_BYTES_REVERSED_LO       = 0x0080
    IMAGE_FILE_32BIT_MACHINE           = 0x0100
    IMAGE_FILE_DEBUG_STRIPPED          = 0x0200
    IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP = 0x0400
    IMAGE_FILE_NET_RUN_FROM_SWAP       = 0x0800
    IMAGE_FILE_SYSTEM                  = 0x1000
    IMAGE_FILE_DLL                     = 0x2000
    IMAGE_FILE_UP_SYSTEM_ONLY          = 0x4000
    IMAGE_FILE_BYTES_REVERSED_HI       = 0x8000
)</pre> <p>OptionalHeader64.Subsystem and OptionalHeader32.Subsystem values. </p>
<pre data-language="go">const (
    IMAGE_SUBSYSTEM_UNKNOWN                  = 0
    IMAGE_SUBSYSTEM_NATIVE                   = 1
    IMAGE_SUBSYSTEM_WINDOWS_GUI              = 2
    IMAGE_SUBSYSTEM_WINDOWS_CUI              = 3
    IMAGE_SUBSYSTEM_OS2_CUI                  = 5
    IMAGE_SUBSYSTEM_POSIX_CUI                = 7
    IMAGE_SUBSYSTEM_NATIVE_WINDOWS           = 8
    IMAGE_SUBSYSTEM_WINDOWS_CE_GUI           = 9
    IMAGE_SUBSYSTEM_EFI_APPLICATION          = 10
    IMAGE_SUBSYSTEM_EFI_BOOT_SERVICE_DRIVER  = 11
    IMAGE_SUBSYSTEM_EFI_RUNTIME_DRIVER       = 12
    IMAGE_SUBSYSTEM_EFI_ROM                  = 13
    IMAGE_SUBSYSTEM_XBOX                     = 14
    IMAGE_SUBSYSTEM_WINDOWS_BOOT_APPLICATION = 16
)</pre> <p>OptionalHeader64.DllCharacteristics and OptionalHeader32.DllCharacteristics values. These can be combined together. </p>
<pre data-language="go">const (
    IMAGE_DLLCHARACTERISTICS_HIGH_ENTROPY_VA       = 0x0020
    IMAGE_DLLCHARACTERISTICS_DYNAMIC_BASE          = 0x0040
    IMAGE_DLLCHARACTERISTICS_FORCE_INTEGRITY       = 0x0080
    IMAGE_DLLCHARACTERISTICS_NX_COMPAT             = 0x0100
    IMAGE_DLLCHARACTERISTICS_NO_ISOLATION          = 0x0200
    IMAGE_DLLCHARACTERISTICS_NO_SEH                = 0x0400
    IMAGE_DLLCHARACTERISTICS_NO_BIND               = 0x0800
    IMAGE_DLLCHARACTERISTICS_APPCONTAINER          = 0x1000
    IMAGE_DLLCHARACTERISTICS_WDM_DRIVER            = 0x2000
    IMAGE_DLLCHARACTERISTICS_GUARD_CF              = 0x4000
    IMAGE_DLLCHARACTERISTICS_TERMINAL_SERVER_AWARE = 0x8000
)</pre> <p>Section characteristics flags. </p>
<pre data-language="go">const (
    IMAGE_SCN_CNT_CODE               = 0x00000020
    IMAGE_SCN_CNT_INITIALIZED_DATA   = 0x00000040
    IMAGE_SCN_CNT_UNINITIALIZED_DATA = 0x00000080
    IMAGE_SCN_LNK_COMDAT             = 0x00001000
    IMAGE_SCN_MEM_DISCARDABLE        = 0x02000000
    IMAGE_SCN_MEM_EXECUTE            = 0x20000000
    IMAGE_SCN_MEM_READ               = 0x40000000
    IMAGE_SCN_MEM_WRITE              = 0x80000000
)</pre> <p>These constants make up the possible values for the 'Selection' field in an AuxFormat5. </p>
<pre data-language="go">const (
    IMAGE_COMDAT_SELECT_NODUPLICATES = 1
    IMAGE_COMDAT_SELECT_ANY          = 2
    IMAGE_COMDAT_SELECT_SAME_SIZE    = 3
    IMAGE_COMDAT_SELECT_EXACT_MATCH  = 4
    IMAGE_COMDAT_SELECT_ASSOCIATIVE  = 5
    IMAGE_COMDAT_SELECT_LARGEST      = 6
)</pre> <pre data-language="go">const COFFSymbolSize = 18</pre> <h2 id="COFFSymbol">type <span>COFFSymbol</span>  <span title="Added in Go 1.1">1.1</span> </h2> <p>COFFSymbol represents single COFF symbol table record. </p>
<pre data-language="go">type COFFSymbol struct {
    Name               [8]uint8
    Value              uint32
    SectionNumber      int16
    Type               uint16
    StorageClass       uint8
    NumberOfAuxSymbols uint8
}
</pre> <h3 id="COFFSymbol.FullName">func (*COFFSymbol) <span>FullName</span>  <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (sym *COFFSymbol) FullName(st StringTable) (string, error)</pre> <p>FullName finds real name of symbol sym. Normally name is stored in sym.Name, but if it is longer then 8 characters, it is stored in COFF string table st instead. </p>
<h2 id="COFFSymbolAuxFormat5">type <span>COFFSymbolAuxFormat5</span>  <span title="Added in Go 1.19">1.19</span> </h2> <p>COFFSymbolAuxFormat5 describes the expected form of an aux symbol attached to a section definition symbol. The PE format defines a number of different aux symbol formats: format 1 for function definitions, format 2 for .be and .ef symbols, and so on. Format 5 holds extra info associated with a section definition, including number of relocations + line numbers, as well as COMDAT info. See <a href="https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-format-5-section-definitions">https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-format-5-section-definitions</a> for more on what's going on here. </p>
<pre data-language="go">type COFFSymbolAuxFormat5 struct {
    Size           uint32
    NumRelocs      uint16
    NumLineNumbers uint16
    Checksum       uint32
    SecNum         uint16
    Selection      uint8
    // contains filtered or unexported fields
}
</pre> <h2 id="DataDirectory">type <span>DataDirectory</span>  <span title="Added in Go 1.3">1.3</span> </h2> <pre data-language="go">type DataDirectory struct {
    VirtualAddress uint32
    Size           uint32
}
</pre> <h2 id="File">type <span>File</span>  </h2> <p>A File represents an open PE file. </p>
<pre data-language="go">type File struct {
    FileHeader
    OptionalHeader any // of type *OptionalHeader32 or *OptionalHeader64; added in Go 1.3
    Sections       []*Section
    Symbols        []*Symbol    // COFF symbols with auxiliary symbol records removed; added in Go 1.1
    COFFSymbols    []COFFSymbol // all COFF symbols (including auxiliary symbol records); added in Go 1.8
    StringTable    StringTable // Go 1.8
    // contains filtered or unexported fields
}
</pre> <h3 id="NewFile">func <span>NewFile</span>  </h3> <pre data-language="go">func NewFile(r io.ReaderAt) (*File, error)</pre> <p>NewFile creates a new <a href="#File">File</a> for accessing a PE binary in an underlying reader. </p>
<h3 id="Open">func <span>Open</span>  </h3> <pre data-language="go">func Open(name string) (*File, error)</pre> <p>Open opens the named file using <span>os.Open</span> and prepares it for use as a PE binary. </p>
<h3 id="File.COFFSymbolReadSectionDefAux">func (*File) <span>COFFSymbolReadSectionDefAux</span>  <span title="Added in Go 1.19">1.19</span> </h3> <pre data-language="go">func (f *File) COFFSymbolReadSectionDefAux(idx int) (*COFFSymbolAuxFormat5, error)</pre> <p>COFFSymbolReadSectionDefAux returns a blob of auxiliary information (including COMDAT info) for a section definition symbol. Here 'idx' is the index of a section symbol in the main <a href="#COFFSymbol">COFFSymbol</a> array for the File. Return value is a pointer to the appropriate aux symbol struct. For more info, see: </p>
<p>auxiliary symbols: <a href="https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-symbol-records">https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-symbol-records</a> COMDAT sections: <a href="https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#comdat-sections-object-only">https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#comdat-sections-object-only</a> auxiliary info for section definitions: <a href="https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-format-5-section-definitions">https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#auxiliary-format-5-section-definitions</a> </p>
<h3 id="File.Close">func (*File) <span>Close</span>  </h3> <pre data-language="go">func (f *File) Close() error</pre> <p>Close closes the <a href="#File">File</a>. If the <a href="#File">File</a> was created using <a href="#NewFile">NewFile</a> directly instead of <a href="#Open">Open</a>, Close has no effect. </p>
<h3 id="File.DWARF">func (*File) <span>DWARF</span>  </h3> <pre data-language="go">func (f *File) DWARF() (*dwarf.Data, error)</pre> <h3 id="File.ImportedLibraries">func (*File) <span>ImportedLibraries</span>  </h3> <pre data-language="go">func (f *File) ImportedLibraries() ([]string, error)</pre> <p>ImportedLibraries returns the names of all libraries referred to by the binary f that are expected to be linked with the binary at dynamic link time. </p>
<h3 id="File.ImportedSymbols">func (*File) <span>ImportedSymbols</span>  </h3> <pre data-language="go">func (f *File) ImportedSymbols() ([]string, error)</pre> <p>ImportedSymbols returns the names of all symbols referred to by the binary f that are expected to be satisfied by other libraries at dynamic load time. It does not return weak symbols. </p>
<h3 id="File.Section">func (*File) <span>Section</span>  </h3> <pre data-language="go">func (f *File) Section(name string) *Section</pre> <p>Section returns the first section with the given name, or nil if no such section exists. </p>
<h2 id="FileHeader">type <span>FileHeader</span>  </h2> <pre data-language="go">type FileHeader struct {
    Machine              uint16
    NumberOfSections     uint16
    TimeDateStamp        uint32
    PointerToSymbolTable uint32
    NumberOfSymbols      uint32
    SizeOfOptionalHeader uint16
    Characteristics      uint16
}
</pre> <h2 id="FormatError">type <span>FormatError</span>  </h2> <p>FormatError is unused. The type is retained for compatibility. </p>
<pre data-language="go">type FormatError struct {
}
</pre> <h3 id="FormatError.Error">func (*FormatError) <span>Error</span>  </h3> <pre data-language="go">func (e *FormatError) Error() string</pre> <h2 id="ImportDirectory">type <span>ImportDirectory</span>  </h2> <pre data-language="go">type ImportDirectory struct {
    OriginalFirstThunk uint32
    TimeDateStamp      uint32
    ForwarderChain     uint32
    Name               uint32
    FirstThunk         uint32
    // contains filtered or unexported fields
}
</pre> <h2 id="OptionalHeader32">type <span>OptionalHeader32</span>  <span title="Added in Go 1.3">1.3</span> </h2> <pre data-language="go">type OptionalHeader32 struct {
    Magic                       uint16
    MajorLinkerVersion          uint8
    MinorLinkerVersion          uint8
    SizeOfCode                  uint32
    SizeOfInitializedData       uint32
    SizeOfUninitializedData     uint32
    AddressOfEntryPoint         uint32
    BaseOfCode                  uint32
    BaseOfData                  uint32
    ImageBase                   uint32
    SectionAlignment            uint32
    FileAlignment               uint32
    MajorOperatingSystemVersion uint16
    MinorOperatingSystemVersion uint16
    MajorImageVersion           uint16
    MinorImageVersion           uint16
    MajorSubsystemVersion       uint16
    MinorSubsystemVersion       uint16
    Win32VersionValue           uint32
    SizeOfImage                 uint32
    SizeOfHeaders               uint32
    CheckSum                    uint32
    Subsystem                   uint16
    DllCharacteristics          uint16
    SizeOfStackReserve          uint32
    SizeOfStackCommit           uint32
    SizeOfHeapReserve           uint32
    SizeOfHeapCommit            uint32
    LoaderFlags                 uint32
    NumberOfRvaAndSizes         uint32
    DataDirectory               [16]DataDirectory
}
</pre> <h2 id="OptionalHeader64">type <span>OptionalHeader64</span>  <span title="Added in Go 1.3">1.3</span> </h2> <pre data-language="go">type OptionalHeader64 struct {
    Magic                       uint16
    MajorLinkerVersion          uint8
    MinorLinkerVersion          uint8
    SizeOfCode                  uint32
    SizeOfInitializedData       uint32
    SizeOfUninitializedData     uint32
    AddressOfEntryPoint         uint32
    BaseOfCode                  uint32
    ImageBase                   uint64
    SectionAlignment            uint32
    FileAlignment               uint32
    MajorOperatingSystemVersion uint16
    MinorOperatingSystemVersion uint16
    MajorImageVersion           uint16
    MinorImageVersion           uint16
    MajorSubsystemVersion       uint16
    MinorSubsystemVersion       uint16
    Win32VersionValue           uint32
    SizeOfImage                 uint32
    SizeOfHeaders               uint32
    CheckSum                    uint32
    Subsystem                   uint16
    DllCharacteristics          uint16
    SizeOfStackReserve          uint64
    SizeOfStackCommit           uint64
    SizeOfHeapReserve           uint64
    SizeOfHeapCommit            uint64
    LoaderFlags                 uint32
    NumberOfRvaAndSizes         uint32
    DataDirectory               [16]DataDirectory
}
</pre> <h2 id="Reloc">type <span>Reloc</span>  <span title="Added in Go 1.8">1.8</span> </h2> <p>Reloc represents a PE COFF relocation. Each section contains its own relocation list. </p>
<pre data-language="go">type Reloc struct {
    VirtualAddress   uint32
    SymbolTableIndex uint32
    Type             uint16
}
</pre> <h2 id="Section">type <span>Section</span>  </h2> <p>Section provides access to PE COFF section. </p>
<pre data-language="go">type Section struct {
    SectionHeader
    Relocs []Reloc // Go 1.8

    // Embed ReaderAt for ReadAt method.
    // Do not embed SectionReader directly
    // to avoid having Read and Seek.
    // If a client wants Read and Seek it must use
    // Open() to avoid fighting over the seek offset
    // with other clients.
    io.ReaderAt
    // contains filtered or unexported fields
}
</pre> <h3 id="Section.Data">func (*Section) <span>Data</span>  </h3> <pre data-language="go">func (s *Section) Data() ([]byte, error)</pre> <p>Data reads and returns the contents of the PE section s. </p>
<p>If s.Offset is 0, the section has no contents, and Data will always return a non-nil error. </p>
<h3 id="Section.Open">func (*Section) <span>Open</span>  </h3> <pre data-language="go">func (s *Section) Open() io.ReadSeeker</pre> <p>Open returns a new ReadSeeker reading the PE section s. </p>
<p>If s.Offset is 0, the section has no contents, and all calls to the returned reader will return a non-nil error. </p>
<h2 id="SectionHeader">type <span>SectionHeader</span>  </h2> <p>SectionHeader is similar to <a href="#SectionHeader32">SectionHeader32</a> with Name field replaced by Go string. </p>
<pre data-language="go">type SectionHeader struct {
    Name                 string
    VirtualSize          uint32
    VirtualAddress       uint32
    Size                 uint32
    Offset               uint32
    PointerToRelocations uint32
    PointerToLineNumbers uint32
    NumberOfRelocations  uint16
    NumberOfLineNumbers  uint16
    Characteristics      uint32
}
</pre> <h2 id="SectionHeader32">type <span>SectionHeader32</span>  </h2> <p>SectionHeader32 represents real PE COFF section header. </p>
<pre data-language="go">type SectionHeader32 struct {
    Name                 [8]uint8
    VirtualSize          uint32
    VirtualAddress       uint32
    SizeOfRawData        uint32
    PointerToRawData     uint32
    PointerToRelocations uint32
    PointerToLineNumbers uint32
    NumberOfRelocations  uint16
    NumberOfLineNumbers  uint16
    Characteristics      uint32
}
</pre> <h2 id="StringTable">type <span>StringTable</span>  <span title="Added in Go 1.8">1.8</span> </h2> <p>StringTable is a COFF string table. </p>
<pre data-language="go">type StringTable []byte</pre> <h3 id="StringTable.String">func (StringTable) <span>String</span>  <span title="Added in Go 1.8">1.8</span> </h3> <pre data-language="go">func (st StringTable) String(start uint32) (string, error)</pre> <p>String extracts string from COFF string table st at offset start. </p>
<h2 id="Symbol">type <span>Symbol</span>  <span title="Added in Go 1.1">1.1</span> </h2> <p>Symbol is similar to <a href="#COFFSymbol">COFFSymbol</a> with Name field replaced by Go string. Symbol also does not have NumberOfAuxSymbols. </p>
<pre data-language="go">type Symbol struct {
    Name          string
    Value         uint32
    SectionNumber int16
    Type          uint16
    StorageClass  uint8
}
</pre><div class="_attribution">
  <p class="_attribution-p">
    &copy; Google, Inc.<br>Licensed under the Creative Commons Attribution License 3.0.<br>
    <a href="http://golang.org/pkg/debug/pe/" class="_attribution-link">http://golang.org/pkg/debug/pe/</a>
  </p>
</div>