Skip to content

Commit 3be4db6

Browse files
authored
update README (#103)
1 parent adc9260 commit 3be4db6

File tree

2 files changed

+30
-29
lines changed

2 files changed

+30
-29
lines changed

README.md

+29-28
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- [Iterating over sections](#iterating-over-sections)
2020
- [Roadmap](#roadmap)
2121
- [Fuzz Testing](#fuzz-testing)
22+
- [Projects Using This Library](#projects-using-this-library)
2223
- [References](#references)
2324

2425
## Features
@@ -86,45 +87,45 @@ Afterwards, a call to the `Parse()` method will give you access to all the diffe
8687

8788
```go
8889
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"`
108110
Header []byte
109111
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
117118
}
118119
```
119120

120121
### PE Header
121122

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.
123124

124125
```go
125126
fmt.Printf("Magic is: 0x%x\n", pe.DOSHeader.Magic)
126127
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())
128129
```
129130

130131
Output:

cmd/dump.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ func parsePE(filename string, cfg config) {
701701
fmt.Printf("\n\t------[ %s ]------\n\n", bndImp.Name)
702702
fmt.Fprintf(w, "TimeDateStamp:\t 0x%x (%s)\n", bndImp.Struct.TimeDateStamp,
703703
humanizeTimestamp(bndImp.Struct.TimeDateStamp))
704-
fmt.Fprintf(w, "Offset Module Name:\t 0x%x\n", bndImp.Struct.OffsetModuleName)
704+
fmt.Fprintf(w, "Offset Module Name:\t 0x%x\n", bndImp.Struct.OffsetModuleName)
705705
fmt.Fprintf(w, "# Module Forwarder Refs:\t 0x%x\n", bndImp.Struct.NumberOfModuleForwarderRefs)
706706
fmt.Fprintf(w, "\n")
707707
if len(bndImp.ForwardedRefs) > 0 {

0 commit comments

Comments
 (0)