pwn 0.5.487 → 0.5.488
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/README.md +3 -3
- data/lib/pwn/plugins/repl.rb +40 -28
- data/lib/pwn/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1c6b217ab3c5fdf16b2cacd41cfdbc77fdcc4fe4f2095490e831a172022bd8e4
|
|
4
|
+
data.tar.gz: 8855d5d95676a6779ec7f81a5c968ca82bbb09e0ffab2ae7bc35d146bce159d8
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 17c944994ed32f740d1e2048598229deea593b1a657fe1a7e9e0928cc23052c31a07ccdff30f90242c395b28073ce5c584d8ab9f45a448b5bd0b3f152ab3a972
|
|
7
|
+
data.tar.gz: f1ad3887c815aaf1ebff5b7113c55ef0e255891f68fcb39a9b8348dc60db1c10f6e03c87802a6c36d5d51781ad0ae8990978232c6cf63fb08eed608455a6db81
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
|
@@ -37,7 +37,7 @@ $ cd /opt/pwn
|
|
|
37
37
|
$ ./install.sh
|
|
38
38
|
$ ./install.sh ruby-gem
|
|
39
39
|
$ pwn
|
|
40
|
-
pwn[v0.5.
|
|
40
|
+
pwn[v0.5.488]:001 >>> PWN.help
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
[](https://youtu.be/G7iLUY4FzsI)
|
|
@@ -52,7 +52,7 @@ $ rvm use ruby-3.4.4@pwn
|
|
|
52
52
|
$ gem uninstall --all --executables pwn
|
|
53
53
|
$ gem install --verbose pwn
|
|
54
54
|
$ pwn
|
|
55
|
-
pwn[v0.5.
|
|
55
|
+
pwn[v0.5.488]:001 >>> PWN.help
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
If you're using a multi-user install of RVM do:
|
|
@@ -62,7 +62,7 @@ $ rvm use ruby-3.4.4@pwn
|
|
|
62
62
|
$ rvmsudo gem uninstall --all --executables pwn
|
|
63
63
|
$ rvmsudo gem install --verbose pwn
|
|
64
64
|
$ pwn
|
|
65
|
-
pwn[v0.5.
|
|
65
|
+
pwn[v0.5.488]:001 >>> PWN.help
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
PWN periodically upgrades to the latest version of Ruby which is reflected in `/opt/pwn/.ruby-version`. The easiest way to upgrade to the latest version of Ruby from a previous PWN installation is to run the following script:
|
data/lib/pwn/plugins/repl.rb
CHANGED
|
@@ -432,7 +432,8 @@ module PWN
|
|
|
432
432
|
|
|
433
433
|
PWN.send(:remove_const, :MeshTxEchoThread) if PWN.const_defined?(:MeshTxEchoThread)
|
|
434
434
|
PWN.send(:remove_const, :MqttObj) if PWN.const_defined?(:MqttObj)
|
|
435
|
-
PWN.send(:remove_const, :
|
|
435
|
+
PWN.send(:remove_const, :MeshRxHeaderWin) if PWN.const_defined?(:MeshRxHeaderWin)
|
|
436
|
+
PWN.send(:remove_const, :MeshRxBodyWin) if PWN.const_defined?(:MeshRxBodyWin)
|
|
436
437
|
PWN.send(:remove_const, :MeshTxWin) if PWN.const_defined?(:MeshTxWin)
|
|
437
438
|
PWN.send(:remove_const, :MeshMutex) if PWN.const_defined?(:MeshMutex)
|
|
438
439
|
PWN.send(:remove_const, :MqttSubThread) if PWN.const_defined?(:MqttSubThread)
|
|
@@ -508,29 +509,37 @@ module PWN
|
|
|
508
509
|
white = mesh_ui_colors[6][:color_id]
|
|
509
510
|
|
|
510
511
|
rx_height = Curses.lines - 4
|
|
511
|
-
|
|
512
|
+
rx_header_win = Curses::Window.new(rx_height, Curses.cols, 0, 0)
|
|
512
513
|
# TODO: Scrollable but should stay below header_line
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
514
|
+
rx_header_win.scrollok(false)
|
|
515
|
+
rx_header_win.nodelay = true
|
|
516
|
+
rx_header_win.attron(Curses.color_pair(cyan) | Curses::A_BOLD)
|
|
516
517
|
|
|
517
518
|
# Make rx_header bold and green
|
|
518
|
-
|
|
519
|
+
rx_header_win.attron(Curses.color_pair(green) | Curses::A_BOLD)
|
|
519
520
|
rx_header = "<<< #{host}:#{port} | #{region}/#{topic} | ch:#{channel_num} >>>"
|
|
520
521
|
rx_header_len = rx_header.length
|
|
521
522
|
rx_header_pos = (Curses.cols / 2) - (rx_header_len / 2)
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
523
|
+
rx_header_win.setpos(1, rx_header_pos)
|
|
524
|
+
rx_header_win.addstr(rx_header)
|
|
525
|
+
rx_header_win.attroff(Curses.color_pair(green) | Curses::A_BOLD)
|
|
525
526
|
# Jump two lines below header before messages begin
|
|
526
|
-
|
|
527
|
-
|
|
527
|
+
rx_header_win.setpos(2, 0)
|
|
528
|
+
rx_header_win.attron(Curses.color_pair(cyan) | Curses::A_BOLD)
|
|
528
529
|
header_line = "\u2014" * Curses.cols
|
|
529
530
|
rx_header_bottom_line_pos = (Curses.cols / 2) - (header_line.length / 2)
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
531
|
+
rx_header_win.addstr(header_line)
|
|
532
|
+
rx_header_win.attroff(Curses.color_pair(cyan) | Curses::A_BOLD)
|
|
533
|
+
rx_header_win.refresh
|
|
534
|
+
PWN.const_set(:MeshRxHeaderWin, rx_header_win)
|
|
535
|
+
|
|
536
|
+
body_start_row = 3
|
|
537
|
+
body_height = rx_height - body_start_row
|
|
538
|
+
rx_body_win = Curses::Window.new(body_height, Curses.cols, body_start_row, 0)
|
|
539
|
+
rx_body_win.scrollok(true)
|
|
540
|
+
rx_body_win.nodelay = true
|
|
541
|
+
rx_body_win.refresh
|
|
542
|
+
PWN.const_set(:MeshRxBodyWin, rx_body_win)
|
|
534
543
|
|
|
535
544
|
tx_height = rx_height - 1
|
|
536
545
|
tx_win = Curses::Window.new(4, Curses.cols, tx_height, 0)
|
|
@@ -538,7 +547,6 @@ module PWN
|
|
|
538
547
|
tx_win.nodelay = true
|
|
539
548
|
tx_win.refresh
|
|
540
549
|
|
|
541
|
-
PWN.const_set(:MeshRxWin, rx_win)
|
|
542
550
|
PWN.const_set(:MeshTxWin, tx_win)
|
|
543
551
|
PWN.const_set(:MeshMutex, Mutex.new)
|
|
544
552
|
|
|
@@ -622,7 +630,7 @@ module PWN
|
|
|
622
630
|
decoded = packet[:decoded]
|
|
623
631
|
next unless decoded.key?(:portnum) && decoded[:portnum] == :TEXT_MESSAGE_APP
|
|
624
632
|
|
|
625
|
-
|
|
633
|
+
# rx_header_win = PWN.const_get(:MeshRxHeaderWin)
|
|
626
634
|
mutex = PWN.const_get(:MeshMutex)
|
|
627
635
|
|
|
628
636
|
from = "#{packet[:node_id_from]} ".ljust(9, ' ')
|
|
@@ -646,26 +654,24 @@ module PWN
|
|
|
646
654
|
to_label = 'DM' unless to == '!ffffffff'
|
|
647
655
|
current_line = "\nDate: #{ts}\nFrom: #{from}\n#{to_label}: #{to}\nTopic: #{absolute_topic}\n> #{rx_text}"
|
|
648
656
|
|
|
649
|
-
|
|
657
|
+
rx_body_win = PWN.const_get(:MeshRxBodyWin)
|
|
658
|
+
rx_body_win.attron(Curses.color_pair(pair) | Curses::A_REVERSE)
|
|
650
659
|
mutex.synchronize do
|
|
651
660
|
inner_height = Curses.lines - 5
|
|
652
661
|
inner_width = Curses.cols
|
|
653
662
|
segments = current_line.scan(/.{1,#{inner_width}}/)
|
|
654
663
|
segments.each do |seg|
|
|
655
|
-
|
|
656
|
-
rx_win.scroll if rx_win.cury >= (inner_height - 1)
|
|
657
|
-
|
|
658
|
-
rx_win.setpos(rx_win.cury, 0)
|
|
664
|
+
rx_body_win.setpos(rx_body_win.cury, 0)
|
|
659
665
|
# Handle wide Unicode characters for proper alignment
|
|
660
666
|
display_width = Unicode::DisplayWidth.of(seg)
|
|
661
667
|
width_diff = seg.length - display_width
|
|
662
668
|
inner_width = Curses.cols + width_diff
|
|
663
669
|
line = seg.ljust(inner_width)
|
|
664
|
-
|
|
670
|
+
rx_body_win.addstr(line)
|
|
665
671
|
end
|
|
666
|
-
|
|
672
|
+
rx_body_win.refresh
|
|
667
673
|
end
|
|
668
|
-
|
|
674
|
+
rx_body_win.attroff(Curses.color_pair(pair) | Curses::A_REVERSE)
|
|
669
675
|
|
|
670
676
|
last_from = from
|
|
671
677
|
end
|
|
@@ -749,10 +755,16 @@ module PWN
|
|
|
749
755
|
PWN.send(:remove_const, :MqttObj)
|
|
750
756
|
end
|
|
751
757
|
|
|
752
|
-
if PWN.const_defined?(:
|
|
753
|
-
PWN.const_get(:
|
|
754
|
-
PWN.send(:remove_const, :
|
|
758
|
+
if PWN.const_defined?(:MeshRxHeaderWin)
|
|
759
|
+
PWN.const_get(:MeshRxHeaderWin).close
|
|
760
|
+
PWN.send(:remove_const, :MeshRxHeaderWin)
|
|
755
761
|
end
|
|
762
|
+
|
|
763
|
+
if PWN.const_defined?(:MeshRxBodyWin)
|
|
764
|
+
PWN.const_get(:MeshRxBodyWin).close
|
|
765
|
+
PWN.send(:remove_const, :MeshRxBodyWin)
|
|
766
|
+
end
|
|
767
|
+
|
|
756
768
|
if PWN.const_defined?(:MeshTxWin)
|
|
757
769
|
PWN.const_get(:MeshTxWin).close
|
|
758
770
|
PWN.send(:remove_const, :MeshTxWin)
|
data/lib/pwn/version.rb
CHANGED