Skip to content

Commit

Permalink
Dependency walker fix (VirusTotal#60)
Browse files Browse the repository at this point in the history
* Added console to list of yaraModules in dependency walker

* simplify documentation for GetDependenciesForRules
  • Loading branch information
gazunder authored Aug 29, 2022
1 parent d317fa2 commit a642c76
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions utils/dependency_walker.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/VirusTotal/gyp/ast"
)

var yaraModules = []string{"pe", "elf", "cuckoo", "magic", "hash", "math", "dotnet", "time", "dex"}
var yaraModules = []string{"pe", "elf", "cuckoo", "magic", "hash", "math", "dotnet", "time", "dex", "console"}

type queueT struct {
node ast.Node
Expand Down Expand Up @@ -106,9 +106,7 @@ func SortRules(rs ast.RuleSet) ast.RuleSet {
return rs
}

// GetDependenciesForRules will find all the dependencies (rules & imports)
// for rules listed in ruleNames. The returned ruleset will only contain rules
// listed in ruleNames along with their dependencies (direct & indirect).
// GetDependenciesForRules returns a ruleset containing dependencies (direct/indirect) for a list of given rules
func GetDependenciesForRules(ruleset ast.RuleSet, ruleNames ...string) (ast.RuleSet, error) {
// Make sure ruleNames and ruleset are not empty
if len(ruleset.Rules) == 0 {
Expand Down

0 comments on commit a642c76

Please sign in to comment.