File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,17 +24,18 @@ import (
2424 "errors"
2525 "expvar"
2626 "fmt"
27+ "os"
28+ "path/filepath"
29+ "strings"
30+ "time"
31+
2732 "github.com/rabbitstack/fibratus/pkg/sys"
2833 "github.com/rabbitstack/fibratus/pkg/util/format"
2934 "github.com/rabbitstack/fibratus/pkg/util/va"
3035 peparser "github.com/saferwall/pe"
3136 peparserlog "github.com/saferwall/pe/log"
3237 log "github.com/sirupsen/logrus"
3338 "golang.org/x/sys/windows"
34- "os"
35- "path/filepath"
36- "strings"
37- "time"
3839)
3940
4041var (
4950 directoryParseErrors = expvar .NewInt ("pe.directory.parse.errors" )
5051 versionResourcesParseErrors = expvar .NewInt ("pe.version.resources.parse.errors" )
5152 imphashErrors = expvar .NewInt ("pe.imphash.errors" )
53+ parserWarnings = expvar .NewMap ("pe.parser.warnings" )
5254)
5355
5456type opts struct {
@@ -237,7 +239,7 @@ func (l Logger) Log(level peparserlog.Level, keyvals ...interface{}) error {
237239 case peparserlog .LevelInfo :
238240 log .Info (keyvals [1 :]... )
239241 case peparserlog .LevelWarn :
240- log . Warn ( keyvals [1 :]... )
242+ parserWarnings . Add ( fmt . Sprintf ( "%s" , keyvals [1 :]), 1 )
241243 case peparserlog .LevelError , peparserlog .LevelFatal :
242244 log .Error (keyvals [1 :]... )
243245 default :
You can’t perform that action at this time.
0 commit comments