Compare commits
14 Commits
master
...
tui-viewpo
Author | SHA1 | Date | |
---|---|---|---|
a87b092f0f | |||
f1569b06e7 | |||
98eb606b4e | |||
fb803dc68c | |||
957a606aae | |||
52f419dfa3 | |||
![]() |
c84a110f6e | ||
![]() |
878def56ec | ||
![]() |
90d21a02dd | ||
![]() |
c3f2942b85 | ||
![]() |
324bfff597 | ||
![]() |
c89316d781 | ||
![]() |
1dfaf1fe20 | ||
![]() |
a75d123d3a |
4
go.mod
4
go.mod
@ -4,8 +4,12 @@ go 1.16
|
||||
|
||||
require (
|
||||
git.tcp.direct/kayos/prototooth v0.3.1-0.20210513000132-e440008138af
|
||||
github.com/charmbracelet/bubbles v0.7.9
|
||||
github.com/charmbracelet/bubbletea v0.13.4
|
||||
github.com/charmbracelet/lipgloss v0.2.1
|
||||
github.com/go-ole/go-ole v1.2.5 // indirect
|
||||
github.com/godbus/dbus/v5 v5.0.4 // indirect
|
||||
github.com/mattn/go-runewidth v0.0.12
|
||||
github.com/muka/go-bluetooth v0.0.0-20201211051136-07f31c601d33 // indirect
|
||||
github.com/prologic/bitcask v0.3.10
|
||||
github.com/rs/zerolog v1.21.0
|
||||
|
37
go.sum
37
go.sum
@ -24,12 +24,23 @@ github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hC
|
||||
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
|
||||
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
||||
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
|
||||
github.com/atotto/clipboard v0.1.2/go.mod h1:ZY9tmq7sm5xIbd9bOK4onWV4S6X0u6GY7Vn0Yu86PYI=
|
||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||
github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs=
|
||||
github.com/bketelsen/crypt v0.0.3-0.20200106085610-5cbc8cc4026c/go.mod h1:MKsuJmJgSg28kpZDP6UIiPt0e0Oz0kqKNGyRaWEPv84=
|
||||
github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
|
||||
github.com/charmbracelet/bubbles v0.7.9 h1:VaXFgxebUf7i+vhDCT72msF+5C+rj4uUkjik6/zgWLU=
|
||||
github.com/charmbracelet/bubbles v0.7.9/go.mod h1:5WX1sSSjNCgCrzvRMN/z23HxvWaa+AI16Ch0KPZPeDs=
|
||||
github.com/charmbracelet/bubbletea v0.13.1/go.mod h1:tp9tr9Dadh0PLhgiwchE5zZJXm5543JYjHG9oY+5qSg=
|
||||
github.com/charmbracelet/bubbletea v0.13.4 h1:IsUD1A9JQsmOkrWIsYhEG57voUc2rPwmomQyUwH2mkc=
|
||||
github.com/charmbracelet/bubbletea v0.13.4/go.mod h1:b5lOf5mLjMg1tRn1HVla54guZB+jvsyV0yYAQja95zE=
|
||||
github.com/charmbracelet/lipgloss v0.1.2/go.mod h1:5D8zradw52m7QmxRF6QgwbwJi9je84g8MkWiGN07uKg=
|
||||
github.com/charmbracelet/lipgloss v0.2.1 h1:knjqLRtlcDsxss6i0CUhNLuXrNW3TQhFDXlXII2UaZA=
|
||||
github.com/charmbracelet/lipgloss v0.2.1/go.mod h1:uiZUfrHLQN14I0lJ5591WtcHyY1X76pOIPSaRKPY6dE=
|
||||
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
|
||||
github.com/containerd/console v1.0.1 h1:u7SFAJyRqWcG6ogaMAx3KjSTy1e3hT9QxqX7Jco7dRc=
|
||||
github.com/containerd/console v1.0.1/go.mod h1:XUsP6YE/mKtz6bxc+I8UiKKTP04qjQL4qcS3XoQ5xkw=
|
||||
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
|
||||
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
github.com/coreos/etcd v3.3.13+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||
@ -77,6 +88,7 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ
|
||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/goterm v0.0.0-20190703233501-fc88cf888a3f/go.mod h1:nOFQdrUlIlx6M6ODdSpBj1NVA+VgLC6kmw60mkw34H4=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
|
||||
@ -126,10 +138,19 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/lucasb-eyer/go-colorful v1.0.3/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
|
||||
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
|
||||
github.com/lucasb-eyer/go-colorful v1.2.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
|
||||
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||
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-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
|
||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||
github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI=
|
||||
github.com/mattn/go-runewidth v0.0.10/go.mod h1:RAqKPSqVFrSLVXbA8x7dzmKdmGzieGRCM46jaSJTDAk=
|
||||
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=
|
||||
@ -142,6 +163,11 @@ github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:F
|
||||
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68 h1:y1p/ycavWjGT9FnmSjdbWUlLGvcxrY0Rw3ATltrxOhk=
|
||||
github.com/muesli/reflow v0.2.1-0.20210115123740-9e1d0d53df68/go.mod h1:Xk+z4oIWdQqJzsxyjgl3P22oYZnHdZ8FFTHAQQt5BMQ=
|
||||
github.com/muesli/termenv v0.7.2/go.mod h1:ct2L5N2lmix82RaY3bMWwVu/jUFc9Ule0KGDCiKYPh8=
|
||||
github.com/muesli/termenv v0.8.1 h1:9q230czSP3DHVpkaPDXGp0TOfAwyjyYwXlUCQxQSaBk=
|
||||
github.com/muesli/termenv v0.8.1/go.mod h1:kzt/D/4a88RoheZmwfqorY3A+tnsSMA9HJC/fQSFKo0=
|
||||
github.com/muka/go-bluetooth v0.0.0-20200619025933-f6113f7141c5/go.mod h1:yV39+EVOWdnoTe75NyKdo9iuyI3Slyh4t7eQvElUbWE=
|
||||
github.com/muka/go-bluetooth v0.0.0-20201211051136-07f31c601d33 h1:p3srutpE8TpQmOUQ5Qw94jYFUdoG2jBbILeYLroQNoI=
|
||||
github.com/muka/go-bluetooth v0.0.0-20201211051136-07f31c601d33/go.mod h1:dMCjicU6vRBk34dqOmIZm0aod6gUwZXOXzBROqGous0=
|
||||
@ -172,6 +198,9 @@ 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/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=
|
||||
@ -235,6 +264,8 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U
|
||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
@ -302,15 +333,21 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w
|
||||
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
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-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/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-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-20210422114643-f5beecf764ed h1:Ei4bQjjpYUsS4efOUz+5Nz++IVkHk87n2zBA0NxBWc0=
|
||||
golang.org/x/term v0.0.0-20210422114643-f5beecf764ed/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=
|
||||
|
3
main.go
3
main.go
@ -9,13 +9,10 @@ import (
|
||||
projVars "protomolecule/src/vars"
|
||||
"time"
|
||||
|
||||
//projVars "protomolecule/src/vars"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
//"git.tcp.direct/kayos/prototooth"
|
||||
)
|
||||
|
||||
var ScanMgr *scanStuff.Meta
|
||||
|
||||
//const banner = 'IOKWhOKWhOKWhMK34paE4paE4paEICAgICAgICDiloTiloTiloTiloTiloQgICAgICDigKIg4paMIOKWhCDCty4gICAgICAg4paE4paE4paMICDiloTiloTiloQgLiDiloTiloTCtyDiloTigKIg4paE4paM4paE4paE4paMICDiloTiloTiloQgLgrilpDilogg4paE4paI4paA4paEIOKWiMK34paqICAgICDigKLilojiloggIOKWqiAgICAgwrfilojilogg4paQ4paI4paI4paI4paq4paqICAgICDilojilojigKIgIOKWgOKWhC7iloDCt+KWkOKWiCDilozilqrilojilqrilojilojilozilojilojigKIgIOKWgOKWhC7iloDCtwog4paI4paI4paAwrfilpDiloDiloDiloQgIOKWhOKWiOKWgOKWhCAg4paQ4paILuKWqiDiloTilojiloDiloQg4paQ4paIIOKWjOKWkOKWjOKWkOKWiMK3IOKWhOKWiOKWgOKWhCDilojilojilqogIOKWkOKWgOKWgOKWquKWhOKWiOKWiCDiloTiloTilojilozilpDilojilozilojilojilqogIOKWkOKWgOKWgOKWquKWhArilpDilojilqrCt+KAouKWkOKWiOKAouKWiOKWjOKWkOKWiOKWjC7ilpDilowg4paQ4paI4paMwrfilpDilojilowu4paQ4paM4paI4paIIOKWiOKWiOKWjOKWkOKWiOKWjOKWkOKWiOKWjC7ilpDilozilpDilojilozilpDilozilpDilojiloTiloTilozilpDilojilojilojilozilpDilojiloTilojilozilpDilojilozilpDilozilpDilojiloTiloTilowKLuKWgCAgIC7iloAgIOKWgCDiloDilojiloTiloDilqog4paA4paA4paAICDiloDilojiloTiloDilqriloDiloAgIOKWiOKWquKWgOKWgOKWgCDiloDilojiloTiloDilqou4paA4paA4paAICDiloDiloDiloAgwrfiloDiloDiloAgIOKWgOKWgOKWgCAu4paA4paA4paAICDiloDiloDiloAgCg=='
|
||||
|
@ -1,19 +1,50 @@
|
||||
package dust
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"encoding/base64"
|
||||
//pt "github.com/pterm/pterm"
|
||||
"github.com/rs/zerolog/log"
|
||||
projVars "protomolecule/src/vars"
|
||||
//"bufio"
|
||||
//"strings"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
func Must(action string, err error) {
|
||||
if err != nil {
|
||||
log.Fatal().Err(err).Str("action", action).Msg("FATAL_ERROR")
|
||||
// A R T -----------------------
|
||||
const splash = "Ll9fICAgICAgICAsICAgIC4gIC4gICAuICAgICAgICAgLiAgIApbX18pLl8uIF8gLSstIF8gfFwvfCBfIHwgXyAgXy4uIC58IF8gICAgIAp8ICAgWyAgKF8pIHwgKF8pfCAgfChfKXwoLywoXy4oX3x8KC8sCg=="
|
||||
const header = "Ll9fICAgICAgICAsICAgIC4gIC4gICAuICAgICAgICAgLiAgIApbX18pLl8uIF8gLSstIF8gfFwvfCBfIHwgXyAgXy4uIC58IF8gICAgIAp8ICAgWyAgKF8pIHwgKF8pfCAgfChfKXwoLywoXy4oX3x8KC8sCg=="
|
||||
|
||||
// PrintBanner decodes our base64 ansi art to a string and then uses a scanner to print it line by line (for future gradient color effects)
|
||||
func GetBanner() []string {
|
||||
s := b64d(header)
|
||||
var head []string
|
||||
|
||||
scanner := bufio.NewScanner(strings.NewReader(s))
|
||||
for scanner.Scan() {
|
||||
head = append(head, scanner.Text())
|
||||
}
|
||||
|
||||
return head
|
||||
}
|
||||
// -----------------------------
|
||||
|
||||
// E N T R O P Y --------------
|
||||
func getRandomUint32() uint32 {
|
||||
x := time.Now().UnixNano()
|
||||
return uint32((x >> 32) ^ x)
|
||||
}
|
||||
|
||||
// DiceRoll will take in a string slice and return a random member of said slice
|
||||
func DiceRoll(slice []string) string {
|
||||
len := len(slice)
|
||||
n := uint32(0)
|
||||
if len > 0 {
|
||||
n = getRandomUint32() % uint32(len)
|
||||
}
|
||||
return slice[n]
|
||||
}
|
||||
// ---------------------------
|
||||
|
||||
// M I S C / U T I L ---------
|
||||
|
||||
func FirstList() {
|
||||
projVars.ScanList = make(map[string]string)
|
||||
@ -30,33 +61,5 @@ func b64d(str string) string {
|
||||
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)
|
||||
|
||||
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++
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
|
@ -89,17 +89,17 @@ func Awaken() {
|
||||
|
||||
deviceDb, err = bitcask.Open(DataDir + "devices")
|
||||
if err != nil {
|
||||
panic(err.Error)
|
||||
panic(err.Error())
|
||||
}
|
||||
|
||||
attackDb, err = bitcask.Open(DataDir + "exploits")
|
||||
if err != nil {
|
||||
panic(err.Error)
|
||||
panic(err.Error())
|
||||
}
|
||||
|
||||
serviceDb, err = bitcask.Open(DataDir + "services")
|
||||
if err != nil {
|
||||
panic(err.Error)
|
||||
panic(err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,14 +4,10 @@ import (
|
||||
"protomolecule/src/dust"
|
||||
"protomolecule/src/eros"
|
||||
projVars "protomolecule/src/vars"
|
||||
|
||||
//"strconv"
|
||||
|
||||
bluetooth "git.tcp.direct/kayos/prototooth"
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
bluetooth "git.tcp.direct/kayos/prototooth"
|
||||
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -77,6 +73,8 @@ func (s *Scan) Start() error {
|
||||
log.Info().Str("ID", adapterId).Msg("Adapter in Use")
|
||||
|
||||
projVars.ScanAdapter.Scan(func(scanAdapter *bluetooth.Adapter, result bluetooth.ScanResult) {
|
||||
projVars.DiscoveredDeviceChan <- projVars.DiscoveredDevice{ScanResult: result} // Tea
|
||||
|
||||
payload := result.AdvertisementPayload
|
||||
addr := result.Address.String()
|
||||
lname := result.LocalName()
|
||||
@ -138,9 +136,10 @@ func (s *Scan) Start() error {
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("EROS_RECALL_FAILURE")
|
||||
}
|
||||
|
||||
log.Info().Interface("Device", fromEros).Msg("EROS_RECALL")
|
||||
|
||||
if projVars.AttackMode == true && projVars.TrackingMode == false /*changed to false for debug*/ {
|
||||
if projVars.AttackMode == true && projVars.TrackingMode == false {
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
//var PreTargetHandling type
|
||||
|
||||
|
@ -2,11 +2,17 @@ package projVars
|
||||
|
||||
import (
|
||||
"flag"
|
||||
|
||||
bluetooth "git.tcp.direct/kayos/prototooth"
|
||||
"github.com/rs/zerolog"
|
||||
)
|
||||
|
||||
|
||||
type DiscoveredDevice struct {
|
||||
ScanResult bluetooth.ScanResult
|
||||
}
|
||||
|
||||
var DiscoveredDeviceChan = make(chan DiscoveredDevice)
|
||||
|
||||
//The initial list of device in the area
|
||||
var ScanList map[string]string
|
||||
|
||||
|
373
tui.go
Normal file
373
tui.go
Normal file
@ -0,0 +1,373 @@
|
||||
package main
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"github.com/charmbracelet/bubbles/spinner"
|
||||
"github.com/charmbracelet/bubbles/viewport"
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
"github.com/charmbracelet/lipgloss"
|
||||
"github.com/mattn/go-runewidth"
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
//"io"
|
||||
"os"
|
||||
"protomolecule/src/dust"
|
||||
"protomolecule/src/eros"
|
||||
"protomolecule/src/scanStuff"
|
||||
projVars "protomolecule/src/vars"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
var _ScanMgr *scanStuff.Meta
|
||||
|
||||
const (
|
||||
headerHeight = 3
|
||||
footerHeight = 3
|
||||
)
|
||||
|
||||
type model struct {
|
||||
|
||||
// https://github.com/charmbracelet/bubbles/blob/master/viewport/viewport.go
|
||||
viewport viewport.Model
|
||||
content string
|
||||
|
||||
// items on the device list
|
||||
choices []string
|
||||
// which device item our cursor is pointing at
|
||||
cursor int
|
||||
// which device items are selected
|
||||
selected map[int]struct{}
|
||||
// have we determined the window dimensions yet
|
||||
ready bool
|
||||
// it spins
|
||||
spinner spinner.Model
|
||||
}
|
||||
|
||||
func getSpinner() spinner.Model {
|
||||
s := spinner.NewModel()
|
||||
s.Spinner = spinner.Dot
|
||||
s.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("205"))
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
var initialModel = model{
|
||||
choices: []string{"Address" + "RSSI"},
|
||||
// A map which indicates which choices are selected. We're using
|
||||
// the map like a mathematical set. The keys refer to the indexes
|
||||
// of the `choices` slice, above.
|
||||
selected: make(map[int]struct{}),
|
||||
spinner: getSpinner(),
|
||||
cursor: 1,
|
||||
}
|
||||
|
||||
//var reader *io.PipeReader
|
||||
//var writer *io.PipeWriter
|
||||
|
||||
func init() {
|
||||
//reader, writer = io.Pipe()
|
||||
|
||||
// print banner for style points
|
||||
//dust.Splash()
|
||||
|
||||
flag.Parse()
|
||||
|
||||
if *projVars.AFlag {
|
||||
projVars.AttackMode = true
|
||||
}
|
||||
|
||||
if *projVars.DFlag {
|
||||
zerolog.SetGlobalLevel(zerolog.DebugLevel)
|
||||
}
|
||||
|
||||
if *projVars.TFlag {
|
||||
projVars.TrackingMode = true
|
||||
}
|
||||
|
||||
_ScanMgr = &scanStuff.Meta{
|
||||
Count: 0,
|
||||
Scans: make(map[int]*scanStuff.Scan),
|
||||
}
|
||||
|
||||
// TODO: make this a commandline argument
|
||||
// assure the log directory exists
|
||||
var logDir string = "./.logs/"
|
||||
|
||||
err := os.MkdirAll(logDir, 0755)
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
|
||||
// define log file itself using the current date and time
|
||||
Now := time.Now()
|
||||
date := Now.Format(time.RFC3339)
|
||||
logFileName := date + ".log"
|
||||
lf, err := os.OpenFile(logDir+logFileName, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
|
||||
if err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
|
||||
// define pretty printer
|
||||
//consoleWriter := zerolog.ConsoleWriter{
|
||||
// Out: writer,
|
||||
//}
|
||||
|
||||
// initialize simultaneous pretty printing and json logging
|
||||
//multi := zerolog.MultiLevelWriter(consoleWriter, lf)
|
||||
log.Logger = zerolog.New(lf).With().Timestamp().Logger()
|
||||
|
||||
// suppress debug messages unless -d is called
|
||||
zerolog.SetGlobalLevel(zerolog.InfoLevel)
|
||||
|
||||
log.Debug().Msg("Logging initialized")
|
||||
|
||||
log.Debug().Msg("Initializing database engine")
|
||||
// initialize database engine
|
||||
eros.Awaken()
|
||||
|
||||
}
|
||||
|
||||
// this tomfoolery was taken from the example for viewports
|
||||
// i think the reasoning is aligned with the dynamic initialization that comes with this type of model
|
||||
//
|
||||
// tldr; initialization happens repeatedly in the update function
|
||||
func (m model) Init() tea.Cmd {
|
||||
return nil
|
||||
}
|
||||
|
||||
func getFormattedRow(dev projVars.DiscoveredDevice) string {
|
||||
return fmt.Sprintf("%s%s%s",
|
||||
dev.ScanResult.Address.String(),
|
||||
strings.Repeat(" ", 7),
|
||||
func(rssi int16) string {
|
||||
if rssi < -80 {
|
||||
return lipgloss.NewStyle().Foreground(lipgloss.Color("#FF0000")).Render(fmt.Sprintf("%d", rssi))
|
||||
}
|
||||
if rssi < -50 {
|
||||
return lipgloss.NewStyle().Foreground(lipgloss.Color("#FFFF00")).Render(fmt.Sprintf("%d", rssi))
|
||||
} else {
|
||||
return lipgloss.NewStyle().Foreground(lipgloss.Color("#008000")).Render(fmt.Sprintf("%d", rssi))
|
||||
}
|
||||
}(dev.ScanResult.RSSI))
|
||||
}
|
||||
|
||||
// Update is processing "msg"s (messages) which appear to be bubbletea's utilization of channels for IPC
|
||||
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
|
||||
var (
|
||||
//cmd tea.Cmd
|
||||
cmds []tea.Cmd
|
||||
)
|
||||
|
||||
cmds = append(cmds, viewport.Sync(m.viewport))
|
||||
|
||||
switch msg := msg.(type) {
|
||||
|
||||
case tea.WindowSizeMsg:
|
||||
verticalMargins := headerHeight + footerHeight
|
||||
|
||||
// getting the size of the window happens asynchronously so
|
||||
// we wait to receive them (ready) to determine the viewport dimensions
|
||||
if !m.ready {
|
||||
m.viewport = viewport.Model{
|
||||
Width: msg.Width,
|
||||
Height: msg.Height - verticalMargins,
|
||||
}
|
||||
|
||||
m.viewport.YPosition = headerHeight
|
||||
m.viewport.HighPerformanceRendering = true
|
||||
|
||||
// so it looks like this is fetching data from our io.Pipe (io.reader) for every update
|
||||
// i defined said pipe on line 65
|
||||
m.viewport.SetContent(m.content)
|
||||
|
||||
m.ready = true
|
||||
} else {
|
||||
// now that we've figured out window dimensions we define viewport dimensions
|
||||
m.viewport.Width = msg.Width
|
||||
m.viewport.Height = msg.Height - verticalMargins
|
||||
}
|
||||
|
||||
cmds = append(cmds, viewport.Sync(m.viewport))
|
||||
|
||||
// Is it a key press?
|
||||
case tea.KeyMsg:
|
||||
|
||||
// Cool, what was the actual key pressed?
|
||||
switch msg.String() {
|
||||
|
||||
// These keys should exit the program.
|
||||
case "ctrl+c", "q":
|
||||
return m, tea.Quit
|
||||
|
||||
// The "up" and "k" keys move the cursor up
|
||||
case "up", "k":
|
||||
if m.cursor > 1 {
|
||||
m.cursor--
|
||||
}
|
||||
|
||||
// The "down" and "j" keys move the cursor down
|
||||
case "down", "j":
|
||||
if m.cursor < len(m.choices)-1 {
|
||||
m.cursor++
|
||||
}
|
||||
|
||||
// The "enter" key and the spacebar (a literal space) toggle
|
||||
// the selected state for the item that the cursor is pointing at.
|
||||
case "enter", " ":
|
||||
_, ok := m.selected[m.cursor]
|
||||
if ok {
|
||||
delete(m.selected, m.cursor)
|
||||
} else {
|
||||
m.selected[m.cursor] = struct{}{}
|
||||
}
|
||||
}
|
||||
|
||||
// spin that spinner
|
||||
//case spinner.TickMsg:
|
||||
// var cmd tea.Cmd
|
||||
// m.spinner, cmd = m.spinner.Update(msg)
|
||||
// return m, cmd
|
||||
|
||||
// **************************************************
|
||||
// actual protomolecule IPC for bubbletea starts here
|
||||
// **************************************************
|
||||
|
||||
case projVars.DiscoveredDevice:
|
||||
for k, v := range m.choices {
|
||||
if strings.HasPrefix(v, msg.ScanResult.Address.String()) {
|
||||
m.choices[k] = getFormattedRow(msg)
|
||||
for _, dev := range m.choices {
|
||||
m.content += dev
|
||||
}
|
||||
|
||||
cmds = append(cmds, listenForScanResults)
|
||||
|
||||
return m, tea.Batch(cmds...)
|
||||
}
|
||||
}
|
||||
|
||||
m.choices = append(m.choices[func(lLength int) int {
|
||||
if lLength >= 10 {
|
||||
return 1
|
||||
} else {
|
||||
return 0
|
||||
}
|
||||
}(len(m.choices)):],
|
||||
fmt.Sprintf("address: %s rssi: %d", msg.ScanResult.Address.String(), msg.ScanResult.RSSI))
|
||||
|
||||
m.choices = append(m.choices, getFormattedRow(msg))
|
||||
}
|
||||
|
||||
return m, tea.Batch(cmds...)
|
||||
}
|
||||
|
||||
func (m model) View() string {
|
||||
//var head []string
|
||||
|
||||
if !m.ready {
|
||||
return "Loading ProtoMolecule..."
|
||||
}
|
||||
|
||||
// load our banner
|
||||
// head = dust.GetBanner()
|
||||
|
||||
header := lipgloss.NewStyle().
|
||||
Bold(true).
|
||||
Foreground(lipgloss.Color("#5991D4")).
|
||||
Align(lipgloss.Center).
|
||||
PaddingTop(0).
|
||||
PaddingLeft(0).
|
||||
Width(m.viewport.Width).
|
||||
Render("ProtoMolecule")
|
||||
// Render(fmt.Sprintf("\n%s\n%s\n%s", head[0], head[1], head[2]))
|
||||
|
||||
footerTop := "╭──────╮"
|
||||
footerMid := fmt.Sprintf("┤ %3.f%% │", m.viewport.ScrollPercent()*100)
|
||||
footerBot := "╰──────╯"
|
||||
gapSize := m.viewport.Width - runewidth.StringWidth(footerMid)
|
||||
footerTop = strings.Repeat(" ", gapSize) + footerTop
|
||||
footerMid = strings.Repeat("─", gapSize) + footerMid
|
||||
footerBot = strings.Repeat(" ", gapSize) + footerBot
|
||||
footer := fmt.Sprintf("%s\n%s\n%s", footerTop, footerMid, footerBot)
|
||||
|
||||
/* Iterate over our choices
|
||||
NOTE: change to only print n rows (minus header, footer and any padding rows) to ensure
|
||||
that the number of printed rows is not overlapping the number of blank rows available in
|
||||
the terminal; this will cause banding issues as most rows are updated on the screen without
|
||||
being completely re-printed (\r vs \n) Scrolling can be added to the Update().
|
||||
https://github.com/muesli/termenv
|
||||
https://stackoverflow.com/questions/16569433/get-terminal-size-in-go
|
||||
https://stackoverflow.com/questions/24562942/golang-how-do-i-determine-the-number-of-lines-in-a-file-efficiently/24563853
|
||||
*/
|
||||
|
||||
for i, choice := range m.choices {
|
||||
if strings.HasPrefix(choice, " ") {
|
||||
m.content += fmt.Sprintf("%s\n", choice)
|
||||
continue
|
||||
}
|
||||
|
||||
// Is the cursor pointing at this choice?
|
||||
cursor := " " // no cursor
|
||||
if m.cursor == i {
|
||||
//cursor = ">" // cursor!
|
||||
cursor = lipgloss.NewStyle().Blink(true).Render(">")
|
||||
}
|
||||
|
||||
// Is this choice selected?
|
||||
checked := " " // not selected
|
||||
if _, ok := m.selected[i]; ok {
|
||||
checked = lipgloss.
|
||||
NewStyle().
|
||||
Bold(true).
|
||||
Render("x")
|
||||
}
|
||||
|
||||
// Render the row
|
||||
m.content += fmt.Sprintf("%s [%s] %s\n", cursor, checked, choice)
|
||||
}
|
||||
|
||||
// Send the UI for rendering
|
||||
return fmt.Sprintf("%s\n%s\n%s", header, m.viewport.View(), footer)
|
||||
}
|
||||
|
||||
func listenForScanResults() tea.Msg {
|
||||
for {
|
||||
select {
|
||||
case dev, ok := <-projVars.DiscoveredDeviceChan:
|
||||
if ok {
|
||||
//time.Sleep( 1 * time.Second)
|
||||
return dev
|
||||
} else {
|
||||
time.Sleep(250 * time.Millisecond)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func main() {
|
||||
//content := "Starting..."
|
||||
|
||||
p := tea.NewProgram(initialModel)
|
||||
p.EnterAltScreen()
|
||||
defer p.ExitAltScreen()
|
||||
|
||||
log.Debug().Msg("Starting scan")
|
||||
|
||||
var scanID int
|
||||
var scan *scanStuff.Scan
|
||||
|
||||
scanID = _ScanMgr.NewScan()
|
||||
scan = _ScanMgr.Scans[scanID]
|
||||
|
||||
go scan.Start()
|
||||
|
||||
if err := p.Start(); err != nil {
|
||||
log.Fatal().Err(err).Msg("FATAL")
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user