Module: PWN::Banner::Matrix

Defined in:
lib/pwn/banner/matrix.rb

Overview

This plugin processes images into readable text

Class Method Summary collapse

Class Method Details

.authorsObject

Author(s)

0day Inc. <[email protected]>



187
188
189
190
191
# File 'lib/pwn/banner/matrix.rb', line 187

public_class_method def self.authors
  "AUTHOR(S):
    0day Inc. <[email protected]>
  "
end

.getObject

Supported Method Parameters

PWN::Banner::Matrix.get



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/pwn/banner/matrix.rb', line 12

public_class_method def self.get
  rows = cols = 33

  matrix_arr = [
    "\u30a0",
    "\u30a1",
    "\u30a2",
    "\u30a3",
    "\u30a4",
    "\u30a5",
    "\u30a6",
    "\u30a7",
    "\u30a8",
    "\u30a9",
    "\u30aa",
    "\u30ab",
    "\u30ac",
    "\u30ad",
    "\u30ae",
    "\u30af",
    "\u30b0",
    "\u30b1",
    "\u30b2",
    "\u30b3",
    "\u30b4",
    "\u30b5",
    "\u30b6",
    "\u30b7",
    "\u30b8",
    "\u30b9",
    "\u30ba",
    "\u30bb",
    "\u30bc",
    "\u30bd",
    "\u30be",
    "\u30bf",
    "\u30c0",
    "\u30c1",
    "\u30c2",
    "\u30c3",
    "\u30c4",
    "\u30c5",
    "\u30c6",
    "\u30c7",
    "\u30c8",
    "\u30c9",
    "\u30ca",
    "\u30cb",
    "\u30cc",
    "\u30cd",
    "\u30ce",
    "\u30cf",
    "\u30d0",
    "\u30d1",
    "\u30d2",
    "\u30d3",
    "\u30d4",
    "\u30d5",
    "\u30d6",
    "\u30d7",
    "\u30d8",
    "\u30d9",
    "\u30da",
    "\u30db",
    "\u30dc",
    "\u30dd",
    "\u30de",
    "\u30df",
    "\u30e0",
    "\u30e1",
    "\u30e2",
    "\u30e3",
    "\u30e4",
    "\u30e5",
    "\u30e6",
    "\u30e7",
    "\u30e8",
    "\u30e9",
    "\u30ea",
    "\u30eb",
    "\u30ec",
    "\u30ed",
    "\u30ee",
    "\u30ef",
    "\u30f0",
    "\u30f1",
    "\u30f2",
    "\u30f3",
    "\u30f4",
    "\u30f5",
    "\u30f6",
    "\u30f7",
    "\u30f8",
    "\u30f9",
    "\u30fa",
    "\u30fb",
    "\u30fc",
    "\u30fd",
    "\u30fe",
    '0 ',
    '1 ',
    '2 ',
    '3 ',
    '4 ',
    '5 ',
    '6 ',
    '7 ',
    '8 ',
    '9 ',
    'A ',
    'c ',
    'R ',
    'y ',
    'P ',
    't ',
    'U ',
    'm ',
    'x ',
    'Z ',
    ': ',
    '{ ',
    '[ ',
    '} ',
    '] ',
    '| ',
    '` ',
    '~ ',
    '! ',
    '@ ',
    '# ',
    '$ ',
    '% ',
    '^ ',
    '& ',
    '* ',
    '( ',
    ') ',
    '_ ',
    '- ',
    '= ',
    '+ ',
    '> ',
    '< ',
    '. ',
    ', '
  ]

  matrix = ''
  rows.times.each do
    matrix_row = ''
    cols.times.each { matrix_row += "#{matrix_arr.sample} " }
    matrix = "#{matrix}#{matrix_row}\n"
  end

  matrix.green
rescue StandardError => e
  raise e
end

.helpObject

Display Usage for this Module



195
196
197
198
199
200
201
202
203
# File 'lib/pwn/banner/matrix.rb', line 195

public_class_method def self.help
  puts "USAGE:
    #{self}.get

    #{self}.has_you

    #{self}.authors
  "
end

.you?Boolean

Supported Method Parameters

PWN::Banner::Matrix.has_you

Returns:

  • (Boolean)


174
175
176
177
178
179
180
181
182
183
# File 'lib/pwn/banner/matrix.rb', line 174

public_class_method def self.you?
  loop do
    # Clear the screen
    print "\e[2J\e[f"
    puts get
    sleep 0.09
  end
rescue StandardError => e
  raise e
end