new: can.fuzz command

This commit is contained in:
Simone Margaritelli 2024-08-16 13:30:26 +02:00
commit 6f1920f478
5 changed files with 160 additions and 42 deletions

View file

@ -79,6 +79,15 @@ func NewCanModule(s *session.Session) *CANModule {
return mod.Inject(args[0])
}))
mod.AddHandler(session.NewModuleHandler("can.fuzz ID_OR_NODE_NAME", `(?i)^can\.fuzz\s+(.+)$`,
"If an integer frame ID is specified, create a randomized version of it and inject it. If a node name is specified, a random message for the given node will be instead used.",
func(args []string) error {
if !mod.Running() {
return errors.New("can module not running")
}
return mod.Fuzz(args[0])
}))
return mod
}