pwn 0.5.481 → 0.5.482
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/README.md +3 -3
- data/lib/pwn/plugins/repl.rb +22 -17
- 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: f08d37f0ef017a76ac0b7bfea02093a55aebd68954ac13761b6969d4937e44f6
|
|
4
|
+
data.tar.gz: e187138d17aac3845fb86a3166bd7b31013110cd93113227bde83ede9cf4041d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cd0f3d1caa5a0cc98d79daeb267a7577a1ef2fa1ec40eff5a707743206c9c2cbf4fa6c5fcba124be4bddef90331e91466bbddb94de776df605a72f5f3510e52a
|
|
7
|
+
data.tar.gz: 1dac1bc3dac0ab48b2572d43c1dee10e6c9f89c4389c43acfae4ffff4f8d546e7c29c8f77e95a9cf6d2b23df39fd3303ef85065d7f892037a636051d432378c1
|
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.482]: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.482]: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.482]: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
|
@@ -522,11 +522,11 @@ module PWN
|
|
|
522
522
|
rx_win.addstr(rx_header)
|
|
523
523
|
rx_win.attroff(Curses.color_pair(green) | Curses::A_BOLD)
|
|
524
524
|
# Jump two lines below header before messages begin
|
|
525
|
-
rx_win.setpos(2,
|
|
525
|
+
rx_win.setpos(2, 0)
|
|
526
526
|
rx_win.attron(Curses.color_pair(cyan) | Curses::A_BOLD)
|
|
527
|
-
|
|
528
|
-
rx_header_bottom_line_pos = (Curses.cols / 2) - (
|
|
529
|
-
rx_win.addstr(
|
|
527
|
+
header_line = "\u2014" * Curses.cols
|
|
528
|
+
rx_header_bottom_line_pos = (Curses.cols / 2) - (header_line.length / 2)
|
|
529
|
+
rx_win.addstr(header_line)
|
|
530
530
|
rx_win.attroff(Curses.color_pair(cyan) | Curses::A_BOLD)
|
|
531
531
|
|
|
532
532
|
rx_win.refresh
|
|
@@ -552,29 +552,27 @@ module PWN
|
|
|
552
552
|
mutex = PWN.const_get(:MeshMutex)
|
|
553
553
|
msg_input = pi.input.line_buffer.to_s
|
|
554
554
|
ts = Time.now.strftime('%H:%M:%S%z')
|
|
555
|
-
cursor_pos =
|
|
555
|
+
cursor_pos = Readline.point
|
|
556
556
|
prefix = "[#{ts}] [TX] #{tx_prompt} "
|
|
557
557
|
base_line = "#{prefix}#{msg_input}"
|
|
558
558
|
cursor_abs_index = prefix.length + cursor_pos
|
|
559
559
|
current_line = base_line
|
|
560
560
|
if current_line != last_drawn
|
|
561
561
|
mutex.synchronize do
|
|
562
|
-
# Only show draft if after_read hook hasn't just written final TX (heuristic)
|
|
563
562
|
tx_win.clear
|
|
564
563
|
tx_win.attron(Curses.color_pair(red) | Curses::A_BOLD)
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
tx_win.addstr(rx_header_bottom_line)
|
|
564
|
+
tx_header_line_pos = (Curses.cols / 2) - (header_line.length / 2)
|
|
565
|
+
tx_win.addstr(header_line)
|
|
568
566
|
tx_win.attroff(Curses.color_pair(red) | Curses::A_BOLD)
|
|
569
|
-
tx_win.attron(Curses.color_pair(yellow) | Curses::A_BOLD)
|
|
570
567
|
|
|
571
|
-
|
|
568
|
+
tx_win.attron(Curses.color_pair(yellow) | Curses::A_BOLD)
|
|
569
|
+
inner_width = Curses.cols
|
|
572
570
|
segments = current_line.chars.each_slice(inner_width).map(&:join)
|
|
573
|
-
available_rows = tx_win.maxy -
|
|
571
|
+
available_rows = tx_win.maxy - 1
|
|
574
572
|
segments.first(available_rows).each_with_index do |seg, idx|
|
|
575
|
-
tx_win.setpos(1 + idx,
|
|
573
|
+
tx_win.setpos(1 + idx, 0)
|
|
576
574
|
start_index = idx * inner_width
|
|
577
|
-
end_index = start_index + inner_width
|
|
575
|
+
end_index = start_index + inner_width
|
|
578
576
|
if cursor_abs_index.between?(start_index, end_index)
|
|
579
577
|
cursor_col = cursor_abs_index - start_index
|
|
580
578
|
(0..inner_width).each do |col|
|
|
@@ -596,7 +594,7 @@ module PWN
|
|
|
596
594
|
end
|
|
597
595
|
last_drawn = current_line
|
|
598
596
|
end
|
|
599
|
-
sleep 0.
|
|
597
|
+
sleep 0.001
|
|
600
598
|
end
|
|
601
599
|
end
|
|
602
600
|
echo_thread.abort_on_exception = false
|
|
@@ -609,6 +607,7 @@ module PWN
|
|
|
609
607
|
max_threads: 1,
|
|
610
608
|
detach: true
|
|
611
609
|
) do |_|
|
|
610
|
+
last_from = nil
|
|
612
611
|
Meshtastic::MQTT.subscribe(
|
|
613
612
|
mqtt_obj: mqtt_obj,
|
|
614
613
|
region: region,
|
|
@@ -635,8 +634,12 @@ module PWN
|
|
|
635
634
|
colors_arr = PWN.const_get(:MeshColors)
|
|
636
635
|
last_pair = PWN.const_get(:MeshLastPair)
|
|
637
636
|
PWN.send(:remove_const, :MeshLastPair)
|
|
638
|
-
|
|
639
|
-
|
|
637
|
+
if last_from != from
|
|
638
|
+
pair_choices = colors_arr.reject { |c| c == last_pair }
|
|
639
|
+
pair = pair_choices.sample
|
|
640
|
+
else
|
|
641
|
+
pair = last_pair
|
|
642
|
+
end
|
|
640
643
|
PWN.const_set(:MeshLastPair, pair)
|
|
641
644
|
rx_win.attron(Curses.color_pair(pair) | Curses::A_REVERSE)
|
|
642
645
|
|
|
@@ -656,6 +659,8 @@ module PWN
|
|
|
656
659
|
rx_win.refresh
|
|
657
660
|
end
|
|
658
661
|
rx_win.attroff(Curses.color_pair(pair) | Curses::A_REVERSE)
|
|
662
|
+
|
|
663
|
+
last_from = from
|
|
659
664
|
end
|
|
660
665
|
end
|
|
661
666
|
rescue StandardError => e
|
data/lib/pwn/version.rb
CHANGED