|
19 | 19 | - [Iterating over sections](#iterating-over-sections)
|
20 | 20 | - [Roadmap](#roadmap)
|
21 | 21 | - [Fuzz Testing](#fuzz-testing)
|
| 22 | + - [Projects Using This Library](#projects-using-this-library) |
22 | 23 | - [References](#references)
|
23 | 24 |
|
24 | 25 | ## Features
|
@@ -86,45 +87,45 @@ Afterwards, a call to the `Parse()` method will give you access to all the diffe
|
86 | 87 |
|
87 | 88 | ```go
|
88 | 89 | type File struct {
|
89 |
| - DOSHeader ImageDOSHeader |
90 |
| - RichHeader RichHeader |
91 |
| - NtHeader ImageNtHeader |
92 |
| - COFF COFF |
93 |
| - Sections []Section |
94 |
| - Imports []Import |
95 |
| - Export Export |
96 |
| - Debugs []DebugEntry |
97 |
| - Relocations []Relocation |
98 |
| - Resources ResourceDirectory |
99 |
| - TLS TLSDirectory |
100 |
| - LoadConfig LoadConfig |
101 |
| - Exceptions []Exception |
102 |
| - Certificates Certificate |
103 |
| - DelayImports []DelayImport |
104 |
| - BoundImports []BoundImportDescriptorData |
105 |
| - GlobalPtr uint32 |
106 |
| - CLR CLRData |
107 |
| - IAT []IATEntry |
| 90 | + DOSHeader ImageDOSHeader `json:"dos_header,omitempty"` |
| 91 | + RichHeader RichHeader `json:"rich_header,omitempty"` |
| 92 | + NtHeader ImageNtHeader `json:"nt_header,omitempty"` |
| 93 | + COFF COFF `json:"coff,omitempty"` |
| 94 | + Sections []Section `json:"sections,omitempty"` |
| 95 | + Imports []Import `json:"imports,omitempty"` |
| 96 | + Export Export `json:"export,omitempty"` |
| 97 | + Debugs []DebugEntry `json:"debugs,omitempty"` |
| 98 | + Relocations []Relocation `json:"relocations,omitempty"` |
| 99 | + Resources ResourceDirectory `json:"resources,omitempty"` |
| 100 | + TLS TLSDirectory `json:"tls,omitempty"` |
| 101 | + LoadConfig LoadConfig `json:"load_config,omitempty"` |
| 102 | + Exceptions []Exception `json:"exceptions,omitempty"` |
| 103 | + Certificates CertificateSection `json:"certificates,omitempty"` |
| 104 | + DelayImports []DelayImport `json:"delay_imports,omitempty"` |
| 105 | + BoundImports []BoundImportDescriptorData `json:"bound_imports,omitempty"` |
| 106 | + GlobalPtr uint32 `json:"global_ptr,omitempty"` |
| 107 | + CLR CLRData `json:"clr,omitempty"` |
| 108 | + IAT []IATEntry `json:"iat,omitempty"` |
| 109 | + Anomalies []string `json:"anomalies,omitempty"` |
108 | 110 | Header []byte
|
109 | 111 | data mmap.MMap
|
110 |
| - closer io.Closer |
111 |
| - Is64 bool |
112 |
| - Is32 bool |
113 |
| - Anomalies []string |
114 |
| - size uint32 |
115 |
| - f *os.File |
116 |
| - opts *Options |
| 112 | + FileInfo |
| 113 | + size uint32 |
| 114 | + OverlayOffset int64 |
| 115 | + f *os.File |
| 116 | + opts *Options |
| 117 | + logger *log.Helper |
117 | 118 | }
|
118 | 119 | ```
|
119 | 120 |
|
120 | 121 | ### PE Header
|
121 | 122 |
|
122 |
| -As mentionned before, all members of the struct are directly (no getters) accessible, additionally, the fields types has been preserved as the spec defines them, that means if you need to show the prettified version of an `int` type, you have to call the corresponding helper function. |
| 123 | +As mentioned before, all members of the struct are directly (no getters) accessible, additionally, the fields types has been preserved as the spec defines them, that means if you need to show the prettified version of an `int` type, you have to call the corresponding helper function. |
123 | 124 |
|
124 | 125 | ```go
|
125 | 126 | fmt.Printf("Magic is: 0x%x\n", pe.DOSHeader.Magic)
|
126 | 127 | fmt.Printf("Signature is: 0x%x\n", pe.NtHeader.Signature)
|
127 |
| -fmt.Printf("Machine is: 0x%x, Meaning: %s\n", pe.NtHeader.FileHeader.Machine, pe.PrettyMachineType()) |
| 128 | +fmt.Printf("Machine is: 0x%x, Meaning: %s\n", pe.NtHeader.FileHeader.Machine, pe.NtHeader.FileHeader.Machine.String()) |
128 | 129 | ```
|
129 | 130 |
|
130 | 131 | Output:
|
|
0 commit comments