mirror of
https://github.com/bettercap/bettercap.git
synced 2025-03-12 04:36:03 -07:00
misc: small fix or general refactoring i did not bother commenting
This commit is contained in:
parent
7cc9e5b0b6
commit
055ba917a1
modules/hid_recon
@ -5,7 +5,7 @@ import (
|
||||
)
|
||||
|
||||
type FrameBuilder interface {
|
||||
BuildFrames([]*Command)
|
||||
BuildFrames([]*Command) error
|
||||
}
|
||||
|
||||
var FrameBuilders = map[network.HIDType]FrameBuilder{
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user