diff --git a/main.go b/main.go index ec49c8e..dbf5ed0 100644 --- a/main.go +++ b/main.go @@ -16,6 +16,8 @@ type Report struct { Imports []string `json:"Imports"` Exports []string `json:"Exports"` Forwards []string `json:"Forwards"` + + pe.PEFile } var ( @@ -23,12 +25,14 @@ var ( 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 { @@ -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)) } diff --git a/readme.md b/readme.md index d041e61..f2e1297 100644 --- a/readme.md +++ b/readme.md @@ -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": [...], } ``` @@ -24,6 +26,8 @@ Usage of ino: Print Imports only -imphash Print ImpHash only + -v + Print additional fields Required: Path to PE File ```