Merge branch 'development' of ssh://git.tcp.direct:2222/freqy/protomolecule into development
This commit is contained in:
commit
ad3f615a71
1
go.mod
1
go.mod
@ -7,6 +7,7 @@ require (
|
||||
github.com/godbus/dbus/v5 v5.0.4 // indirect
|
||||
github.com/muka/go-bluetooth v0.0.0-20201211051136-07f31c601d33 // indirect
|
||||
github.com/prologic/bitcask v0.3.10
|
||||
github.com/pterm/pterm v0.12.14
|
||||
github.com/rs/zerolog v1.21.0
|
||||
github.com/sirupsen/logrus v1.8.1 // indirect
|
||||
golang.org/x/sys v0.0.0-20210414055047-fe65e336abe0 // indirect
|
||||
|
19
go.sum
19
go.sum
@ -82,6 +82,8 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4
|
||||
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||
github.com/gookit/color v1.4.1 h1:MIizA5j/X2Vb+lWXnjxu3Xav+u5OdqwKMUqrRHNaAmQ=
|
||||
github.com/gookit/color v1.4.1/go.mod h1:fqRyamkC1W8uxl+lxCQxOT09l/vYfZ+QeiX3rKQHCoQ=
|
||||
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||
github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||
@ -128,6 +130,8 @@ github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czP
|
||||
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
|
||||
github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
|
||||
github.com/mattn/go-runewidth v0.0.12 h1:Y41i/hVW3Pgwr8gV+J23B9YEY0zxjptBuCWEaxmAOow=
|
||||
github.com/mattn/go-runewidth v0.0.12/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
|
||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||
github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg=
|
||||
github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc=
|
||||
@ -170,6 +174,11 @@ github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8
|
||||
github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
|
||||
github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
|
||||
github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
|
||||
github.com/pterm/pterm v0.12.14 h1:iCBoFtfhpn7vLuE8dAzA/vzijfolP7oEdh/jv/1nHg4=
|
||||
github.com/pterm/pterm v0.12.14/go.mod h1:kJLnbnOAnwSaee/6kMVtoLr4avzShsFJUAHedynGJ4g=
|
||||
github.com/rivo/uniseg v0.1.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
|
||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
|
||||
@ -209,6 +218,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
|
||||
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
|
||||
github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0=
|
||||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/suapapa/go_eddystone v1.3.1/go.mod h1:bXC11TfJOS+3g3q/Uzd7FKd5g62STQEfeEIhcKe4Qy8=
|
||||
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
|
||||
github.com/tidwall/btree v0.2.2/go.mod h1:huei1BkDWJ3/sLXmO+bsCNELL+Bp2Kks9OLyQFkzvA8=
|
||||
@ -217,6 +228,8 @@ github.com/tidwall/redcon v1.4.0/go.mod h1:IGzxyoKE3Ea5AWIXo/ZHP+hzY8sWXaMKr7KlF
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
|
||||
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8=
|
||||
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs=
|
||||
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
|
||||
@ -305,9 +318,13 @@ golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200826173525-f9321e4c35a6/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210414055047-fe65e336abe0 h1:g9s1Ppvvun/fI+BptTMj909BBIcGrzQ32k9FNlcevOE=
|
||||
golang.org/x/sys v0.0.0-20210414055047-fe65e336abe0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE=
|
||||
golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
@ -377,6 +394,8 @@ gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
|
||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||
|
12
main.go
12
main.go
@ -17,9 +17,12 @@ import (
|
||||
|
||||
var ScanMgr *scanStuff.Meta
|
||||
|
||||
const banner = 'IOKWhOKWhOKWhMK34paE4paE4paEICAgICAgICDiloTiloTiloTiloTiloQgICAgICDigKIg4paMIOKWhCDCty4gICAgICAg4paE4paE4paMICDiloTiloTiloQgLiDiloTiloTCtyDiloTigKIg4paE4paM4paE4paE4paMICDiloTiloTiloQgLgrilpDilogg4paE4paI4paA4paEIOKWiMK34paqICAgICDigKLilojiloggIOKWqiAgICAgwrfilojilogg4paQ4paI4paI4paI4paq4paqICAgICDilojilojigKIgIOKWgOKWhC7iloDCt+KWkOKWiCDilozilqrilojilqrilojilojilozilojilojigKIgIOKWgOKWhC7iloDCtwog4paI4paI4paAwrfilpDiloDiloDiloQgIOKWhOKWiOKWgOKWhCAg4paQ4paILuKWqiDiloTilojiloDiloQg4paQ4paIIOKWjOKWkOKWjOKWkOKWiMK3IOKWhOKWiOKWgOKWhCDilojilojilqogIOKWkOKWgOKWgOKWquKWhOKWiOKWiCDiloTiloTilojilozilpDilojilozilojilojilqogIOKWkOKWgOKWgOKWquKWhArilpDilojilqrCt+KAouKWkOKWiOKAouKWiOKWjOKWkOKWiOKWjC7ilpDilowg4paQ4paI4paMwrfilpDilojilowu4paQ4paM4paI4paIIOKWiOKWiOKWjOKWkOKWiOKWjOKWkOKWiOKWjC7ilpDilozilpDilojilozilpDilozilpDilojiloTiloTilozilpDilojilojilojilozilpDilojiloTilojilozilpDilojilozilpDilozilpDilojiloTiloTilowKLuKWgCAgIC7iloAgIOKWgCDiloDilojiloTiloDilqog4paA4paA4paAICDiloDilojiloTiloDilqriloDiloAgIOKWiOKWquKWgOKWgOKWgCDiloDilojiloTiloDilqou4paA4paA4paAICDiloDiloDiloAgwrfiloDiloDiloAgIOKWgOKWgOKWgCAu4paA4paA4paAICDiloDiloDiloAgCg=='
|
||||
|
||||
func init() {
|
||||
// initialize database engine
|
||||
eros.Awaken()
|
||||
// print banner for style points
|
||||
dust.Splash()
|
||||
|
||||
|
||||
ScanMgr = &scanStuff.Meta{
|
||||
Count: 0,
|
||||
@ -59,6 +62,11 @@ func init() {
|
||||
}
|
||||
}
|
||||
log.Debug().Msg("Logging initialized")
|
||||
|
||||
log.Debug().Msg("Initializing database engine")
|
||||
// initialize database engine
|
||||
eros.Awaken()
|
||||
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
@ -1,10 +1,12 @@
|
||||
package dust
|
||||
|
||||
//
|
||||
|
||||
import (
|
||||
"encoding/base64"
|
||||
pt "github.com/pterm/pterm"
|
||||
"github.com/rs/zerolog/log"
|
||||
projVars "protomolecule/src/vars"
|
||||
"bufio"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func Must(action string, err error) {
|
||||
@ -21,3 +23,41 @@ func FirstList() {
|
||||
func OhNameMeZaddy() {
|
||||
|
||||
}
|
||||
|
||||
func b64d(str string) string {
|
||||
data, err := base64.StdEncoding.DecodeString(str)
|
||||
if err != nil {
|
||||
return err.Error()
|
||||
}
|
||||
return string(data)
|
||||
}
|
||||
|
||||
func Splash() {
|
||||
const banner string = "IOKWhOKWhOKWhMK34paE4paE4paEICAgICAgICDiloTiloTiloTiloTiloQgICAgICDigKIg4paMIOKWhCDCty4gICAgICAg4paE4paE4paMICDiloTiloTiloQgLiDiloTiloTCtyDiloTigKIg4paE4paM4paE4paE4paMICDiloTiloTiloQgLgrilpDilogg4paE4paI4paA4paEIOKWiMK34paqICAgICDigKLilojiloggIOKWqiAgICAgwrfilojilogg4paQ4paI4paI4paI4paq4paqICAgICDilojilojigKIgIOKWgOKWhC7iloDCt+KWkOKWiCDilozilqrilojilqrilojilojilozilojilojigKIgIOKWgOKWhC7iloDCtwog4paI4paI4paAwrfilpDiloDiloDiloQgIOKWhOKWiOKWgOKWhCAg4paQ4paILuKWqiDiloTilojiloDiloQg4paQ4paIIOKWjOKWkOKWjOKWkOKWiMK3IOKWhOKWiOKWgOKWhCDilojilojilqogIOKWkOKWgOKWgOKWquKWhOKWiOKWiCDiloTiloTilojilozilpDilojilozilojilojilqogIOKWkOKWgOKWgOKWquKWhArilpDilojilqrCt+KAouKWkOKWiOKAouKWiOKWjOKWkOKWiOKWjC7ilpDilowg4paQ4paI4paMwrfilpDilojilowu4paQ4paM4paI4paIIOKWiOKWiOKWjOKWkOKWiOKWjOKWkOKWiOKWjC7ilpDilozilpDilojilozilpDilozilpDilojiloTiloTilozilpDilojilojilojilozilpDilojiloTilojilozilpDilojilozilpDilozilpDilojiloTiloTilowKLuKWgCAgIC7iloAgIOKWgCDiloDilojiloTiloDilqog4paA4paA4paAICDiloDilojiloTiloDilqriloDiloAgIOKWiOKWquKWgOKWgOKWgCDiloDilojiloTiloDilqou4paA4paA4paAICDiloDiloDiloAgwrfiloDiloDiloAgIOKWgOKWgOKWgCAu4paA4paA4paAICDiloDiloDiloAgCg=="
|
||||
lines := make(map[int]string)
|
||||
var count int = 0
|
||||
|
||||
s := b64d(banner)
|
||||
|
||||
xerox := bufio.NewScanner(strings.NewReader(s))
|
||||
from := pt.NewRGB(180, 111, 229)
|
||||
to := pt.NewRGB(0, 162, 173)
|
||||
|
||||
from.Println("from")
|
||||
to.Println("to")
|
||||
|
||||
for xerox.Scan() {
|
||||
lines[count] = xerox.Text()
|
||||
count++
|
||||
//from.Fade(0
|
||||
}
|
||||
|
||||
total := count
|
||||
count = 0
|
||||
|
||||
for _, line := range lines {
|
||||
from.Fade(0, float32(total), float32(count), to).Println(line[count])
|
||||
count++
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,9 +53,12 @@ type Service struct {
|
||||
// deviceDb will hold details about devices discovered
|
||||
var deviceDb *bitcask.Bitcask
|
||||
|
||||
// attackDb will hold details about exploits to be used against BLE devices
|
||||
// attackDb will hold details about exploits to be used against BLE devices
|
||||
var attackDb *bitcask.Bitcask
|
||||
|
||||
// serviceDb will hold definitions of various bluetook services and will ultimately be updated via an HTTP repository
|
||||
var serviceDb *bitcask.Bitcask
|
||||
|
||||
var err error
|
||||
|
||||
// DataDir - should be defined by config or cmd flag
|
||||
@ -93,6 +96,11 @@ func Awaken() {
|
||||
if err != nil {
|
||||
panic(err.Error)
|
||||
}
|
||||
|
||||
serviceDb, err = bitcask.Open(DataDir + "services")
|
||||
if err != nil {
|
||||
panic(err.Error)
|
||||
}
|
||||
}
|
||||
|
||||
// exists - check if a device is present in the Database
|
||||
|
@ -121,8 +121,6 @@ func (s *Scan) Start() error {
|
||||
|
||||
})
|
||||
|
||||
//time.Sleep(1 * time.Second)
|
||||
|
||||
TargetDevice, _ := projVars.ScanAdapter.Connect(result.Address, bluetooth.ConnectionParams{})
|
||||
|
||||
var targetServices []bluetooth.DeviceService
|
||||
@ -134,7 +132,6 @@ func (s *Scan) Start() error {
|
||||
buf := make([]byte, 255)
|
||||
|
||||
for _, srvcs := range targetServices {
|
||||
|
||||
charSer := eros.Service{
|
||||
UUID: srvcs.String(),
|
||||
}
|
||||
@ -160,8 +157,7 @@ func (s *Scan) Start() error {
|
||||
|
||||
}
|
||||
|
||||
sublog.Debug().Str("Connected and enumerated", charSer.UUID).Msg("Yay!")
|
||||
|
||||
sublog.Debug().Str("Connected and enumerated", charSer.UUID).Msg("CONNECTION_SUCCESSFUL")
|
||||
}
|
||||
|
||||
TargetDevice.Disconnect()
|
||||
|
23
vendor/modules.txt
vendored
23
vendor/modules.txt
vendored
@ -1,5 +1,7 @@
|
||||
# github.com/JuulLabs-OSS/cbgo v0.0.2
|
||||
github.com/JuulLabs-OSS/cbgo
|
||||
# github.com/davecgh/go-spew v1.1.1
|
||||
github.com/davecgh/go-spew/spew
|
||||
# github.com/fatih/structs v1.1.0
|
||||
github.com/fatih/structs
|
||||
# github.com/go-ole/go-ole v1.2.5
|
||||
@ -10,6 +12,10 @@ github.com/go-ole/go-ole
|
||||
github.com/godbus/dbus/v5
|
||||
github.com/godbus/dbus/v5/introspect
|
||||
github.com/godbus/dbus/v5/prop
|
||||
# github.com/gookit/color v1.4.1
|
||||
github.com/gookit/color
|
||||
# github.com/mattn/go-runewidth v0.0.12
|
||||
github.com/mattn/go-runewidth
|
||||
# github.com/muka/go-bluetooth v0.0.0-20201211051136-07f31c601d33
|
||||
## explicit
|
||||
github.com/muka/go-bluetooth/api
|
||||
@ -27,6 +33,8 @@ github.com/muka/go-bluetooth/util
|
||||
github.com/pkg/errors
|
||||
# github.com/plar/go-adaptive-radix-tree v1.0.4
|
||||
github.com/plar/go-adaptive-radix-tree
|
||||
# github.com/pmezard/go-difflib v1.0.0
|
||||
github.com/pmezard/go-difflib/difflib
|
||||
# github.com/prologic/bitcask v0.3.10
|
||||
## explicit
|
||||
github.com/prologic/bitcask
|
||||
@ -37,6 +45,12 @@ github.com/prologic/bitcask/internal/data
|
||||
github.com/prologic/bitcask/internal/data/codec
|
||||
github.com/prologic/bitcask/internal/index
|
||||
github.com/prologic/bitcask/internal/metadata
|
||||
# github.com/pterm/pterm v0.12.14
|
||||
## explicit
|
||||
github.com/pterm/pterm
|
||||
github.com/pterm/pterm/internal
|
||||
# github.com/rivo/uniseg v0.2.0
|
||||
github.com/rivo/uniseg
|
||||
# github.com/rs/zerolog v1.21.0
|
||||
## explicit
|
||||
github.com/rs/zerolog
|
||||
@ -46,13 +60,22 @@ github.com/rs/zerolog/log
|
||||
# github.com/sirupsen/logrus v1.8.1
|
||||
## explicit
|
||||
github.com/sirupsen/logrus
|
||||
# github.com/stretchr/testify v1.7.0
|
||||
github.com/stretchr/testify/assert
|
||||
# github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778
|
||||
github.com/xo/terminfo
|
||||
# golang.org/x/exp v0.0.0-20200228211341-fcea875c7e85
|
||||
golang.org/x/exp/mmap
|
||||
# golang.org/x/sys v0.0.0-20210414055047-fe65e336abe0
|
||||
## explicit
|
||||
golang.org/x/sys/internal/unsafeheader
|
||||
golang.org/x/sys/plan9
|
||||
golang.org/x/sys/unix
|
||||
golang.org/x/sys/windows
|
||||
# golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d
|
||||
golang.org/x/term
|
||||
# gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
|
||||
gopkg.in/yaml.v3
|
||||
# tinygo.org/x/bluetooth v0.3.0
|
||||
## explicit
|
||||
tinygo.org/x/bluetooth
|
||||
|
6
vendor/tinygo.org/x/bluetooth/adapter_linux.go
generated
vendored
6
vendor/tinygo.org/x/bluetooth/adapter_linux.go
generated
vendored
@ -12,7 +12,7 @@ import (
|
||||
|
||||
type Adapter struct {
|
||||
adapter *adapter.Adapter1
|
||||
ID string
|
||||
id string
|
||||
cancelChan chan struct{}
|
||||
defaultAdvertisement *Advertisement
|
||||
|
||||
@ -32,12 +32,12 @@ var DefaultAdapter = &Adapter{
|
||||
// Enable configures the BLE stack. It must be called before any
|
||||
// Bluetooth-related calls (unless otherwise indicated).
|
||||
func (a *Adapter) Enable() (err error) {
|
||||
if a.ID == "" {
|
||||
if a.id == "" {
|
||||
a.adapter, err = api.GetDefaultAdapter()
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
a.ID, err = a.adapter.GetAdapterID()
|
||||
a.id, err = a.adapter.GetAdapterID()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
64
vendor/tinygo.org/x/bluetooth/gap.go
generated
vendored
64
vendor/tinygo.org/x/bluetooth/gap.go
generated
vendored
@ -123,9 +123,6 @@ type AdvertisementPayload interface {
|
||||
// UUIDs and 128-bit UUIDs.
|
||||
HasServiceUUID(UUID) bool
|
||||
|
||||
//Optputs what i think is the raw data packet
|
||||
ServiceUUIDOut() []UUID
|
||||
|
||||
// Bytes returns the raw advertisement packet, if available. It returns nil
|
||||
// if this data is not available.
|
||||
Bytes() []byte
|
||||
@ -167,16 +164,6 @@ func (p *advertisementFields) HasServiceUUID(uuid UUID) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (p *advertisementFields) ServiceUUIDOut() []UUID {
|
||||
return p.AdvertisementFields.ServiceUUIDs
|
||||
}
|
||||
|
||||
/*
|
||||
func (p *advertisementFields) ServiceUUIDOut() []UUID {
|
||||
return p.AdvertisementFields.ServiceUUIDs
|
||||
}
|
||||
*/
|
||||
|
||||
// Bytes returns nil, as structured advertisement data does not have the
|
||||
// original raw advertisement data available.
|
||||
func (p *advertisementFields) Bytes() []byte {
|
||||
@ -187,13 +174,13 @@ func (p *advertisementFields) Bytes() []byte {
|
||||
// get the data (such as LocalName()) will parse just the needed field. Scanning
|
||||
// the data should be fast as most advertisement packets only have a very small
|
||||
// (3 or so) amount of fields.
|
||||
type RawAdvertisementPayload struct {
|
||||
type rawAdvertisementPayload struct {
|
||||
data [31]byte
|
||||
len uint8
|
||||
}
|
||||
|
||||
// Bytes returns the raw advertisement packet as a byte slice.
|
||||
func (buf *RawAdvertisementPayload) Bytes() []byte {
|
||||
func (buf *rawAdvertisementPayload) Bytes() []byte {
|
||||
return buf.data[:buf.len]
|
||||
}
|
||||
|
||||
@ -201,7 +188,7 @@ func (buf *RawAdvertisementPayload) Bytes() []byte {
|
||||
//
|
||||
// See this list of field types:
|
||||
// https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile/
|
||||
func (buf *RawAdvertisementPayload) FindField(fieldType byte) []byte {
|
||||
func (buf *rawAdvertisementPayload) findField(fieldType byte) []byte {
|
||||
data := buf.Bytes()
|
||||
for len(data) >= 2 {
|
||||
fieldLength := data[0]
|
||||
@ -219,12 +206,12 @@ func (buf *RawAdvertisementPayload) FindField(fieldType byte) []byte {
|
||||
|
||||
// LocalName returns the local name (complete or shortened) in the advertisement
|
||||
// payload.
|
||||
func (buf *RawAdvertisementPayload) LocalName() string {
|
||||
b := buf.FindField(9) // Complete Local Name
|
||||
func (buf *rawAdvertisementPayload) LocalName() string {
|
||||
b := buf.findField(9) // Complete Local Name
|
||||
if len(b) != 0 {
|
||||
return string(b)
|
||||
}
|
||||
b = buf.FindField(8) // Shortened Local Name
|
||||
b = buf.findField(8) // Shortened Local Name
|
||||
if len(b) != 0 {
|
||||
return string(b)
|
||||
}
|
||||
@ -234,11 +221,11 @@ func (buf *RawAdvertisementPayload) LocalName() string {
|
||||
// HasServiceUUID returns true whether the given UUID is present in the
|
||||
// advertisement payload as a Service Class UUID. It checks both 16-bit UUIDs
|
||||
// and 128-bit UUIDs.
|
||||
func (buf *RawAdvertisementPayload) HasServiceUUID(uuid UUID) bool {
|
||||
func (buf *rawAdvertisementPayload) HasServiceUUID(uuid UUID) bool {
|
||||
if uuid.Is16Bit() {
|
||||
b := buf.FindField(0x03) // Complete List of 16-bit Service Class UUIDs
|
||||
b := buf.findField(0x03) // Complete List of 16-bit Service Class UUIDs
|
||||
if len(b) == 0 {
|
||||
b = buf.FindField(0x02) // Incomplete List of 16-bit Service Class UUIDs
|
||||
b = buf.findField(0x02) // Incomplete List of 16-bit Service Class UUIDs
|
||||
}
|
||||
uuid := uuid.Get16Bit()
|
||||
for i := 0; i < len(b)/2; i++ {
|
||||
@ -249,9 +236,9 @@ func (buf *RawAdvertisementPayload) HasServiceUUID(uuid UUID) bool {
|
||||
}
|
||||
return false
|
||||
} else {
|
||||
b := buf.FindField(0x07) // Complete List of 128-bit Service Class UUIDs
|
||||
b := buf.findField(0x07) // Complete List of 128-bit Service Class UUIDs
|
||||
if len(b) == 0 {
|
||||
b = buf.FindField(0x06) // Incomplete List of 128-bit Service Class UUIDs
|
||||
b = buf.findField(0x06) // Incomplete List of 128-bit Service Class UUIDs
|
||||
}
|
||||
uuidBuf1 := uuid.Bytes()
|
||||
for i := 0; i < len(b)/16; i++ {
|
||||
@ -271,27 +258,8 @@ func (buf *RawAdvertisementPayload) HasServiceUUID(uuid UUID) bool {
|
||||
}
|
||||
}
|
||||
|
||||
/// Very dumb attempts at reworking this code ************************************************
|
||||
var FUUID uint16
|
||||
|
||||
func (buf *RawAdvertisementPayload) FindServiceUUIDInfo(uuid UUID) uint16 {
|
||||
if uuid.Is16Bit() {
|
||||
b := buf.FindField(0x03) // Complete List of 16-bit Service Class UUIDs
|
||||
if len(b) == 0 {
|
||||
b = buf.FindField(0x02) // Incomplete List of 16-bit Service Class UUIDs
|
||||
}
|
||||
for i := 0; i < len(b)/2; i++ {
|
||||
foundUUID := uint16(b[i*2]) | (uint16(b[i*2+1]) << 8)
|
||||
|
||||
FUUID = foundUUID
|
||||
}
|
||||
|
||||
}
|
||||
return FUUID
|
||||
}
|
||||
|
||||
// reset restores this buffer to the original state.
|
||||
func (buf *RawAdvertisementPayload) reset() {
|
||||
func (buf *rawAdvertisementPayload) reset() {
|
||||
// The data is not reset (only the length), because with a zero length the
|
||||
// data is undefined.
|
||||
buf.len = 0
|
||||
@ -300,7 +268,7 @@ func (buf *RawAdvertisementPayload) reset() {
|
||||
// addFromOptions constructs a new advertisement payload (assumed to be empty
|
||||
// before the call) from the advertisement options. It returns true if it fits,
|
||||
// false otherwise.
|
||||
func (buf *RawAdvertisementPayload) addFromOptions(options AdvertisementOptions) (ok bool) {
|
||||
func (buf *rawAdvertisementPayload) addFromOptions(options AdvertisementOptions) (ok bool) {
|
||||
buf.addFlags(0x06)
|
||||
if options.LocalName != "" {
|
||||
if !buf.addCompleteLocalName(options.LocalName) {
|
||||
@ -322,7 +290,7 @@ func (buf *RawAdvertisementPayload) addFromOptions(options AdvertisementOptions)
|
||||
|
||||
// addFlags adds a flags field to the advertisement buffer. It returns true on
|
||||
// success (the flags can be added) and false on failure.
|
||||
func (buf *RawAdvertisementPayload) addFlags(flags byte) (ok bool) {
|
||||
func (buf *rawAdvertisementPayload) addFlags(flags byte) (ok bool) {
|
||||
if int(buf.len)+3 > len(buf.data) {
|
||||
return false // flags don't fit
|
||||
}
|
||||
@ -336,7 +304,7 @@ func (buf *RawAdvertisementPayload) addFlags(flags byte) (ok bool) {
|
||||
|
||||
// addCompleteLocalName adds the Complete Local Name field to the advertisement
|
||||
// buffer. It returns true on success (the name fits) and false on failure.
|
||||
func (buf *RawAdvertisementPayload) addCompleteLocalName(name string) (ok bool) {
|
||||
func (buf *rawAdvertisementPayload) addCompleteLocalName(name string) (ok bool) {
|
||||
if int(buf.len)+len(name)+2 > len(buf.data) {
|
||||
return false // name doesn't fit
|
||||
}
|
||||
@ -351,7 +319,7 @@ func (buf *RawAdvertisementPayload) addCompleteLocalName(name string) (ok bool)
|
||||
// addServiceUUID adds a Service Class UUID (16-bit or 128-bit). It has
|
||||
// currently only been designed for adding single UUIDs: multiple UUIDs are
|
||||
// stored in separate fields without joining them together in one field.
|
||||
func (buf *RawAdvertisementPayload) addServiceUUID(uuid UUID) (ok bool) {
|
||||
func (buf *rawAdvertisementPayload) addServiceUUID(uuid UUID) (ok bool) {
|
||||
// Don't bother with 32-bit UUID support, it doesn't seem to be used in
|
||||
// practice.
|
||||
if uuid.Is16Bit() {
|
||||
|
4
vendor/tinygo.org/x/bluetooth/gap_linux.go
generated
vendored
4
vendor/tinygo.org/x/bluetooth/gap_linux.go
generated
vendored
@ -59,7 +59,7 @@ func (a *Advertisement) Start() error {
|
||||
if a.advertisement != nil {
|
||||
panic("todo: start advertisement a second time")
|
||||
}
|
||||
_, err := api.ExposeAdvertisement(a.adapter.ID, a.properties, uint32(a.properties.Timeout))
|
||||
_, err := api.ExposeAdvertisement(a.adapter.id, a.properties, uint32(a.properties.Timeout))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -219,8 +219,6 @@ func makeScanResult(props *device.Device1Properties) ScanResult {
|
||||
serviceUUIDs = append(serviceUUIDs, parsedUUID)
|
||||
}
|
||||
|
||||
//var ManufactuerData UUID
|
||||
|
||||
a := Address{MACAddress{MAC: addr}}
|
||||
a.SetRandom(props.AddressType == "random")
|
||||
|
||||
|
2
vendor/tinygo.org/x/bluetooth/gattc_linux.go
generated
vendored
2
vendor/tinygo.org/x/bluetooth/gattc_linux.go
generated
vendored
@ -39,7 +39,6 @@ func (s *DeviceService) UUID() UUID {
|
||||
// services haven't been resolved yet) and uses this list of cached services.
|
||||
func (d *Device) DiscoverServices(uuids []UUID) ([]DeviceService, error) {
|
||||
for {
|
||||
|
||||
resolved, err := d.device.GetServicesResolved()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -48,6 +47,7 @@ func (d *Device) DiscoverServices(uuids []UUID) ([]DeviceService, error) {
|
||||
break
|
||||
}
|
||||
// This is a terrible hack, but I couldn't find another way.
|
||||
|
||||
time.Sleep(50 * time.Millisecond)
|
||||
}
|
||||
|
||||
|
2
vendor/tinygo.org/x/bluetooth/gatts_linux.go
generated
vendored
2
vendor/tinygo.org/x/bluetooth/gatts_linux.go
generated
vendored
@ -18,7 +18,7 @@ type Characteristic struct {
|
||||
// Service struct.
|
||||
func (a *Adapter) AddService(s *Service) error {
|
||||
app, err := service.NewApp(service.AppOptions{
|
||||
AdapterID: a.ID,
|
||||
AdapterID: a.id,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user