diff --git a/Gemfile.lock b/Gemfile.lock index ac6b9ef..c5b2415 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - ctf-party (2.1.0) + ctf-party (2.2.0) docopt (~> 0.6) GEM diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index b72302d..788fe2a 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [Unreleased] +## [2.2.0] - CLI: - Add `urlencode_component` and `urldecode_component` to the command whitelist diff --git a/docs/yard/String.html b/docs/yard/String.html index e8c9fe2..de840ba 100644 --- a/docs/yard/String.html +++ b/docs/yard/String.html @@ -6,7 +6,7 @@ Class: String - — Documentation by YARD 0.9.27 + — Documentation by YARD 0.9.28 @@ -3204,8 +3204,6 @@

 
 
-218
-219
 220
 221
 222
@@ -3215,10 +3213,12 @@ 

226 227 228 -229

+229 +230 +231 -
# File 'lib/ctf_party/hex.rb', line 218
+      
# File 'lib/ctf_party/hex.rb', line 220
 
 def bin2hex(opts = {})
   opts[:prefix] ||= ''
@@ -3273,12 +3273,12 @@ 

 
 
-237
-238
-239
+239 +240 +241

-
# File 'lib/ctf_party/hex.rb', line 237
+      
# File 'lib/ctf_party/hex.rb', line 239
 
 def bin2hex!(opts = {})
   replace(bin2hex(opts))
@@ -3533,7 +3533,9 @@ 

62 63 64 -65

+65 +66 +67
# File 'lib/ctf_party/hex.rb', line 49
@@ -3551,8 +3553,10 @@ 

out = ('0' * (opts[:padding] - out.size)) + out if out.size < opts[:padding] # char case management out = out.upcase if opts[:case] == :upper - # adding prefix must be done after case change - out = out.scan(/.{2}/).map { |x| opts[:prefixall] + x }.join + # adding prefix must be done after case change, complex conditional to avoid cropping when odd byte lenght + out = (out.size.odd? ? [out[0]] + out[1..].scan(/.{1,2}/) : out.scan(/.{2}/)).map do |x| + opts[:prefixall] + x + end.join return opts[:prefix] + out end

@@ -3596,12 +3600,12 @@

 
 
-73
-74
-75
+75 +76 +77

-
# File 'lib/ctf_party/hex.rb', line 73
+      
# File 'lib/ctf_party/hex.rb', line 75
 
 def dec2hex!(opts = {})
   replace(dec2hex(opts))
@@ -4477,8 +4481,6 @@ 

 
 
-146
-147
 148
 149
 150
@@ -4487,10 +4489,12 @@ 

153 154 155 -156

+156 +157 +158

-
# File 'lib/ctf_party/hex.rb', line 146
+      
# File 'lib/ctf_party/hex.rb', line 148
 
 def from_hex(opts = {})
   opts[:prefix] ||= ''
@@ -4544,12 +4548,12 @@ 

 
 
-169
-170
-171
+171 +172 +173

-
# File 'lib/ctf_party/hex.rb', line 169
+      
# File 'lib/ctf_party/hex.rb', line 171
 
 def from_hex!(opts = {})
   replace(from_hex(opts))
@@ -4667,8 +4671,6 @@ 

 
 
-252
-253
 254
 255
 256
@@ -4676,10 +4678,12 @@ 

258 259 260 -261

+261 +262 +263

-
# File 'lib/ctf_party/hex.rb', line 252
+      
# File 'lib/ctf_party/hex.rb', line 254
 
 def from_hexip(opts = {})
   opts[:prefix] ||= ''
@@ -4722,12 +4726,12 @@ 

 
 
-265
-266
-267
+267 +268 +269

-
# File 'lib/ctf_party/hex.rb', line 265
+      
# File 'lib/ctf_party/hex.rb', line 267
 
 def from_hexip!(opts = {})
   replace(from_hexip(opts))
@@ -4832,16 +4836,16 @@ 

 
 
-187
-188
 189
 190
 191
 192
-193
+193 +194 +195

-
# File 'lib/ctf_party/hex.rb', line 187
+      
# File 'lib/ctf_party/hex.rb', line 189
 
 def hex2bin(opts = {})
   opts[:prefix] ||= ''
@@ -4891,12 +4895,12 @@ 

 
 
-201
-202
-203
+203 +204 +205

-
# File 'lib/ctf_party/hex.rb', line 201
+      
# File 'lib/ctf_party/hex.rb', line 203
 
 def hex2bin!(opts = {})
   replace(hex2bin(opts))
@@ -5101,12 +5105,12 @@ 

 
 
-159
-160
-161
+161 +162 +163

-
# File 'lib/ctf_party/hex.rb', line 159
+      
# File 'lib/ctf_party/hex.rb', line 161
 
 def hex2str(opts = {})
   from_hex(opts)
@@ -5141,12 +5145,12 @@ 

 
 
-174
-175
-176
+176 +177 +178

-
# File 'lib/ctf_party/hex.rb', line 174
+      
# File 'lib/ctf_party/hex.rb', line 176
 
 def hex2str!(opts = {})
   from_hex!(opts)
@@ -5206,12 +5210,12 @@ 

 
 
-71
 72
-73
+73 +74

-
# File 'lib/ctf_party/cgi.rb', line 71
+      
# File 'lib/ctf_party/cgi.rb', line 72
 
 def htmlescape
   CGI.escapeHTML self
@@ -5246,12 +5250,12 @@ 

 
 
-76
 77
-78
+78 +79

-
# File 'lib/ctf_party/cgi.rb', line 76
+      
# File 'lib/ctf_party/cgi.rb', line 77
 
 def htmlescape!
   replace(htmlescape)
@@ -5311,12 +5315,12 @@ 

 
 
-84
 85
-86
+86 +87

-
# File 'lib/ctf_party/cgi.rb', line 84
+      
# File 'lib/ctf_party/cgi.rb', line 85
 
 def htmlunescape
   CGI.unescapeHTML self
@@ -5351,12 +5355,12 @@ 

 
 
-89
 90
-91
+91 +92

-
# File 'lib/ctf_party/cgi.rb', line 89
+      
# File 'lib/ctf_party/cgi.rb', line 90
 
 def htmlunescape!
   replace(htmlunescape)
@@ -7003,12 +7007,12 @@ 

 
 
-115
-116
-117
+117 +118 +119

-
# File 'lib/ctf_party/hex.rb', line 115
+      
# File 'lib/ctf_party/hex.rb', line 117
 
 def str2hex(opts = {})
   to_hex(opts)
@@ -7043,12 +7047,12 @@ 

 
 
-130
-131
-132
+132 +133 +134

-
# File 'lib/ctf_party/hex.rb', line 130
+      
# File 'lib/ctf_party/hex.rb', line 132
 
 def str2hex!(opts = {})
   to_hex!(opts)
@@ -7655,8 +7659,6 @@ 

 
 
-94
-95
 96
 97
 98
@@ -7673,10 +7675,12 @@ 

109 110 111 -112

+112 +113 +114

-
# File 'lib/ctf_party/hex.rb', line 94
+      
# File 'lib/ctf_party/hex.rb', line 96
 
 def to_hex(opts = {})
   opts[:prefix] ||= ''
@@ -7738,12 +7742,12 @@ 

 
 
-125
-126
-127
+127 +128 +129

-
# File 'lib/ctf_party/hex.rb', line 125
+      
# File 'lib/ctf_party/hex.rb', line 127
 
 def to_hex!(opts = {})
   replace(to_hex(opts))
@@ -7887,8 +7891,6 @@ 

 
 
-284
-285
 286
 287
 288
@@ -7901,10 +7903,12 @@ 

295 296 297 -298

+298 +299 +300

-
# File 'lib/ctf_party/hex.rb', line 284
+      
# File 'lib/ctf_party/hex.rb', line 286
 
 def to_hexip(opts = {})
   opts[:prefix] ||= ''
@@ -7952,12 +7956,12 @@ 

 
 
-302
-303
-304
+304 +305 +306

-
# File 'lib/ctf_party/hex.rb', line 302
+      
# File 'lib/ctf_party/hex.rb', line 304
 
 def to_hexip!(opts = {})
   replace(to_hexip(opts))
@@ -8155,12 +8159,12 @@ 

 
 
-42
 43
-44
+44 +45

-
# File 'lib/ctf_party/cgi.rb', line 42
+      
# File 'lib/ctf_party/cgi.rb', line 43
 
 def urldecode
   URI::Parser.new.unescape self
@@ -8195,12 +8199,12 @@ 

 
 
-47
 48
-49
+49 +50

-
# File 'lib/ctf_party/cgi.rb', line 47
+      
# File 'lib/ctf_party/cgi.rb', line 48
 
 def urldecode!
   replace(urldecode)
@@ -8263,12 +8267,12 @@ 

 
 
-58
 59
-60
+60 +61

-
# File 'lib/ctf_party/cgi.rb', line 58
+      
# File 'lib/ctf_party/cgi.rb', line 59
 
 def urldecode_component
   CGI.unescape self
@@ -8303,12 +8307,12 @@ 

 
 
-63
 64
-65
+65 +66

-
# File 'lib/ctf_party/cgi.rb', line 63
+      
# File 'lib/ctf_party/cgi.rb', line 64
 
 def urldecode_component!
   replace(urldecode_component)
@@ -8369,12 +8373,12 @@ 

 
 
-12
 13
-14
+14 +15

-
# File 'lib/ctf_party/cgi.rb', line 12
+      
# File 'lib/ctf_party/cgi.rb', line 13
 
 def urlencode
   URI::Parser.new.escape self
@@ -8409,12 +8413,12 @@ 

 
 
-17
 18
-19
+19 +20

-
# File 'lib/ctf_party/cgi.rb', line 17
+      
# File 'lib/ctf_party/cgi.rb', line 18
 
 def urlencode!
   replace(urlencode)
@@ -8475,12 +8479,12 @@ 

 
 
-26
 27
-28
+28 +29

-
# File 'lib/ctf_party/cgi.rb', line 26
+      
# File 'lib/ctf_party/cgi.rb', line 27
 
 def urlencode_component
   CGI.escape self
@@ -8515,12 +8519,12 @@ 

 
 
-31
 32
-33
+33 +34

-
# File 'lib/ctf_party/cgi.rb', line 31
+      
# File 'lib/ctf_party/cgi.rb', line 32
 
 def urlencode_component!
   replace(urlencode_component)
@@ -8670,9 +8674,9 @@ 

diff --git a/docs/yard/Version.html b/docs/yard/Version.html index 9891bb4..4bbd0f2 100644 --- a/docs/yard/Version.html +++ b/docs/yard/Version.html @@ -6,7 +6,7 @@ Module: Version - — Documentation by YARD 0.9.27 + — Documentation by YARD 0.9.28 @@ -95,7 +95,7 @@

VERSION =
-
'2.1.0'
+
'2.2.0'
@@ -111,9 +111,9 @@

diff --git a/docs/yard/_index.html b/docs/yard/_index.html index da8c5a3..e46eb0e 100644 --- a/docs/yard/_index.html +++ b/docs/yard/_index.html @@ -4,7 +4,7 @@ - Documentation by YARD 0.9.27 + Documentation by YARD 0.9.28 @@ -52,7 +52,7 @@
-

Documentation by YARD 0.9.27

+

Documentation by YARD 0.9.28

Alphabetic Index

@@ -113,9 +113,9 @@

Namespace Listing A-Z

diff --git a/docs/yard/file.LICENSE.html b/docs/yard/file.LICENSE.html index 30ca12f..ded1991 100644 --- a/docs/yard/file.LICENSE.html +++ b/docs/yard/file.LICENSE.html @@ -6,7 +6,7 @@ File: LICENSE - — Documentation by YARD 0.9.27 + — Documentation by YARD 0.9.28 @@ -60,9 +60,9 @@
The MIT License (MIT)

Copyright (c) 2020-2020 Alexandre ZANNI
Copyright (c) 2019-2020 Alexandre ZANNI at Orange Cyberdefense

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
diff --git a/docs/yard/file.README.html b/docs/yard/file.README.html index 0212467..89e9f3c 100644 --- a/docs/yard/file.README.html +++ b/docs/yard/file.README.html @@ -6,7 +6,7 @@ File: README - — Documentation by YARD 0.9.27 + — Documentation by YARD 0.9.28 @@ -114,9 +114,9 @@

Author

diff --git a/docs/yard/frames.html b/docs/yard/frames.html index 54704af..a65e936 100644 --- a/docs/yard/frames.html +++ b/docs/yard/frames.html @@ -2,7 +2,7 @@ - Documentation by YARD 0.9.27 + Documentation by YARD 0.9.28