| 1 | package hidscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/ |
| 2 | |
| 3 | import ( |
| 4 | "github.com/bettercap/bettercap/networkscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/network`/" |
| 5 | ) |
| 6 | |
| 7 | const ( |
| 8 | amzFrameDelayscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/amzFrameDelay. = 5 |
| 9 | ) |
| 10 | |
| 11 | type AmazonBuilderscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/AmazonBuilder# struct { |
| 12 | } |
| 13 | |
| 14 | func (b AmazonBuilderscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/AmazonBuilder#) frameForscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/AmazonBuilder#frameFor().(cmd *Commandscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/Command#) []byte { |
| 15 | return []byte{0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 16 | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 17 | 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, |
| 18 | 0x0f, 0, cmd.Modescip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/Command#Mode., 0, cmd.HIDscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/Command#HID., 0} |
| 19 | } |
| 20 | |
| 21 | func (b AmazonBuilderscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/AmazonBuilder#) BuildFramesscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/AmazonBuilder#BuildFrames().(dev *networkscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/network`/.HIDDevicescip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/network`/HIDDevice#, commands []*Commandscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/Command#) error { |
| 22 | for i, cmd := range commands { |
| 23 | if i == 0 { |
| 24 | for j := 0; j < 5; j++ { |
| 25 | cmd.AddFramescip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/Command#AddFrame().(b.frameForscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/AmazonBuilder#frameFor().(&Commandscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/Command#{}), amzFrameDelayscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/amzFrameDelay.) |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | if cmd.IsHIDscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/Command#IsHID().() { |
| 30 | cmd.AddFramescip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/Command#AddFrame().(b.frameForscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/AmazonBuilder#frameFor().(cmd), amzFrameDelayscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/amzFrameDelay.) |
| 31 | cmd.AddFramescip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/Command#AddFrame().(b.frameForscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/AmazonBuilder#frameFor().(&Commandscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/Command#{}), amzFrameDelayscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/amzFrameDelay.) |
| 32 | } else if cmd.IsSleepscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/Command#IsSleep().() { |
| 33 | for i, num := 0, cmd.Sleepscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/Command#Sleep./10; i < num; i++ { |
| 34 | cmd.AddFramescip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/Command#AddFrame().(b.frameForscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/AmazonBuilder#frameFor().(&Commandscip-go gomod github.com/bettercap/bettercap . `github.com/bettercap/bettercap/modules/hid`/Command#{}), 10) |
| 35 | } |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | return nil |
| 40 | } |