-
Notifications
You must be signed in to change notification settings - Fork 2
/
main_notwindows.go
41 lines (34 loc) · 1.06 KB
/
main_notwindows.go
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
//+build !windows
package main
import (
"www.velocidex.com/golang/go-pe"
)
// Report contains the parsed import and exports of the PE
type Report struct {
Name string `json:"Name"`
Path string `json:"Path"`
Dir string `json:"Dir"`
Type string `json:"Type"`
ImpHash string `json:"ImpHash"`
Exports []string `json:"Exports"`
Imports []PEFunction `json:"Imports"`
Forwards []PEFunction `json:"Forwards"`
GUIDAge string `json:",omitempty"`
PDB string `json:",omitempty"`
Sections []*pe.Section `json:",omitempty"`
}
func populatePEReport(report *Report, peFile *pe.PEFile) error {
report.ImpHash = peFile.ImpHash()
report.Imports = genPEFunctions(peFile.Imports())
report.Forwards = genPEFunctions(patchForwards(peFile.Forwards()))
report.Exports = patchExports(peFile.Exports())
if verbose {
report.Sections = peFile.Sections
report.PDB = peFile.PDB
}
return nil
}
func handleDirPerms(report *Report) error {
// not yet implementd
return nil
}