Skip to content

Commit

Permalink
include parent folder for convenience
Browse files Browse the repository at this point in the history
  • Loading branch information
audibleblink committed Aug 25, 2021
1 parent c0debc6 commit db81d3b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ func newDirectoryReport(path string) *Report {
report.Name = filepath.Base(path)
report.Path, _ = filepath.Abs(path)
report.Type = "directory"
report.Dir = filepath.Dir(path)
err := handleDirPerms(report)
if err != nil {
return report
Expand Down
1 change: 1 addition & 0 deletions main_notwindows.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
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"`
Expand Down
3 changes: 3 additions & 0 deletions main_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"fmt"
"path/filepath"
"strings"

"github.com/Microsoft/go-winio"
Expand All @@ -14,6 +15,7 @@ import (
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"`
Expand Down Expand Up @@ -42,6 +44,7 @@ func populatePEReport(report *Report, peFile *pe.PEFile) error {
report.Imports = genPEFunctions(peFile.Imports())
report.Forwards = genPEFunctions(patchForwards(peFile.Forwards()))
report.Exports = patchExports(peFile.Exports())
report.Dir = filepath.Dir(report.Path)

if verbose {
report.Sections = peFile.Sections
Expand Down

0 comments on commit db81d3b

Please sign in to comment.