Skip to content

Commit b2a416c

Browse files
committed
pwn_serial_son_micro_sm132_rfid Driver - slightly better output to stdout
1 parent 13e7540 commit b2a416c

File tree

4 files changed

+18
-10
lines changed

4 files changed

+18
-10
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ $ rvm use ruby-3.1.2@pwn
3737
$ rvm list gemsets
3838
$ gem install --verbose pwn
3939
$ pwn
40-
pwn[v0.4.485]:001 >>> PWN.help
40+
pwn[v0.4.486]:001 >>> PWN.help
4141
```
4242

4343
[![Installing the pwn Security Automation Framework](https://raw.githubusercontent.com/0dayInc/pwn/master/documentation/pwn_install.png)](https://youtu.be/G7iLUY4FzsI)
@@ -52,7 +52,7 @@ $ rvm use ruby-3.1.2@pwn
5252
$ gem uninstall --all --executables pwn
5353
$ gem install --verbose pwn
5454
$ pwn
55-
pwn[v0.4.485]:001 >>> PWN.help
55+
pwn[v0.4.486]:001 >>> PWN.help
5656
```
5757

5858

bin/pwn_serial_son_micro_sm132_rfid

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ begin
7777
puts '[(B)ackup Card]'
7878
puts '[(C)opy Card]'
7979
puts '[(L)oad Card from File]'
80+
puts '[(W)arm Reset]'
8081
puts '[(Q)uit]'
8182
puts menu_msg
8283
print 'MAIN MENU OPTION >>> '
@@ -104,6 +105,12 @@ begin
104105
rfid_data = PWN::Plugins::SonMicroRFID.load_card_from_file(
105106
son_micro_rfid_obj: son_micro_rfid_obj
106107
)
108+
when :W
109+
menu_msg = 'WARM RESET'
110+
exec_resp = PWN::Plugins::SonMicroRFID.exec(
111+
son_micro_rfid_obj: son_micro_rfid_obj,
112+
cmd: :reset
113+
)
107114
when :Q
108115
exit
109116
else

lib/pwn/plugins/son_micro_rfid.rb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,14 @@ module SonMicroRFID
164164

165165
cmd_resp = all_cmd_responses.last
166166
bytes_in_cmd_resp = cmd_resp.split.length
167-
puts "EXPECTED CMD BYTE LEN: #{expected_cmd_resp_byte_len}"
168-
puts "LAST CMD BYTE LEN: #{bytes_in_cmd_resp} >>>"
169-
puts all_cmd_responses
170-
puts "COMMAND HEX: #{cmd_hex}\n\n\n"
167+
# puts "EXPECTED CMD BYTE LEN: #{expected_cmd_resp_byte_len}"
168+
# puts "LAST CMD BYTE LEN: #{bytes_in_cmd_resp} >>>"
169+
# puts all_cmd_responses
170+
# puts "COMMAND HEX: #{cmd_hex}\n\n\n"
171171
end
172172

173-
puts "\nALL CMD RESPS >>>"
174-
puts "#{all_cmd_responses}\n\n\n"
173+
# puts "\nALL CMD RESPS >>>"
174+
# puts "#{all_cmd_responses}\n\n\n"
175175

176176
parsed_cmd_resp_hash = {}
177177
parsed_cmd_resp_hash[:raw_resp] = PWN::Plugins::Serial.dump_session_data.inspect
@@ -343,11 +343,12 @@ module SonMicroRFID
343343

344344
public_class_method def self.read_card(opts = {})
345345
son_micro_rfid_obj = opts[:son_micro_rfid_obj]
346+
print 'Ready to Read. Please Scan Card Now:'
346347
rfid_data = exec(
347348
son_micro_rfid_obj: son_micro_rfid_obj,
348349
cmd: :seek_for_tag
349350
)
350-
puts rfid_data.inspect
351+
puts "#{rfid_data[:resp_code_desc]} >>> #{rfid_data[:tag_id]}"
351352

352353
rfid_data
353354
rescue StandardError => e

lib/pwn/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module PWN
4-
VERSION = '0.4.485'
4+
VERSION = '0.4.486'
55
end

0 commit comments

Comments
 (0)