Skip to content

Commit

Permalink
adds -v option: prints pdb, headers, sections
Browse files Browse the repository at this point in the history
  • Loading branch information
audibleblink committed May 25, 2021
1 parent f491537 commit 5ced06d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
11 changes: 11 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,23 @@ type Report struct {
Imports []string `json:"Imports"`
Exports []string `json:"Exports"`
Forwards []string `json:"Forwards"`

pe.PEFile
}

var (
pePath string
printImpHash bool
printImports bool
printExports bool
verbose bool
)

func init() {
flag.BoolVar(&printImpHash, "imphash", false, "Print ImpHash only")
flag.BoolVar(&printImports, "imports", false, "Print Imports only")
flag.BoolVar(&printExports, "exports", false, "Print Exports only")
flag.BoolVar(&verbose, "v", false, "Print additional fields")
flag.Parse()

if flag.NArg() == 0 {
Expand Down Expand Up @@ -80,6 +84,13 @@ func main() {
report.Imports = peFile.Imports()
report.Exports = peFile.Exports()
report.Forwards = peFile.Forwards()

if verbose {
report.FileHeader = peFile.FileHeader
report.Sections = peFile.Sections
report.PDB = peFile.PDB
}

serialized, _ := json.Marshal(report)
fmt.Println(string(serialized))
}
10 changes: 7 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
Parses PEs and spits out Imports and Exports

```
ino comsvcs.dll
ino -v comsvcs.dll
{
"Name": "comsvcs.dll",
"Imports": [...],
"Exports": [...],
"Forwards": [...]
"Forwards": [...],
"PDB": "",
"FileHeader": [...],
"Sections": [...],
}
```
Expand All @@ -24,6 +26,8 @@ Usage of ino:
Print Imports only
-imphash
Print ImpHash only
-v
Print additional fields
<pe_file>
Required: Path to PE File
```

0 comments on commit 5ced06d

Please sign in to comment.