diff --git a/modules/hid_recon/hid_builders.go b/modules/hid_recon/hid_builders.go index 4b774c2e..527ed6eb 100644 --- a/modules/hid_recon/hid_builders.go +++ b/modules/hid_recon/hid_builders.go @@ -5,7 +5,7 @@ import ( ) type FrameBuilder interface { - BuildFrames([]*Command) + BuildFrames([]*Command) error } var FrameBuilders = map[network.HIDType]FrameBuilder{ diff --git a/modules/hid_recon/hid_inject.go b/modules/hid_recon/hid_inject.go index f752f631..58641885 100644 --- a/modules/hid_recon/hid_inject.go +++ b/modules/hid_recon/hid_inject.go @@ -74,7 +74,9 @@ func (mod *HIDRecon) prepInjection() (error, *network.HIDDevice, []*Command) { } } - builder.BuildFrames(cmds) + if err := builder.BuildFrames(cmds); err != nil { + return err, nil, nil + } return nil, dev, cmds } diff --git a/modules/hid_recon/hid_logitech.go b/modules/hid_recon/hid_logitech.go index 6530e353..f7ac5b49 100644 --- a/modules/hid_recon/hid_logitech.go +++ b/modules/hid_recon/hid_logitech.go @@ -27,7 +27,7 @@ func (b LogitechBuilder) frameFor(cmd *Command) []byte { return data } -func (b LogitechBuilder) BuildFrames(commands []*Command) { +func (b LogitechBuilder) BuildFrames(commands []*Command) error { numCommands := len(commands) for i, cmd := range commands { if i == 0 { @@ -51,4 +51,6 @@ func (b LogitechBuilder) BuildFrames(commands []*Command) { } } } + + return nil }