lib/ronin/cli/commands/decode.rb in ronin-2.0.0.beta3 vs lib/ronin/cli/commands/decode.rb in ronin-2.0.0.beta4
- old
+ new
@@ -32,30 +32,41 @@
#
# -f, --file FILE Optional file to process
# --string STRING Optional string to process
# -M, --multiline Process each line separately
# -n, --keep-newlines Preserves newlines at the end of each line
+ # --base16 Base16 decodes the data
# --base32 Base32 decodes the data
# -b, --base64=[strict|url] Base64 decodes the data
+ # -z, --zlib Zlib compresses the data
+ # -g, --gzip gzip compresses the data
# -c, --c Encodes the data as a C string
# -X, --hex Hex decode the data (ex: "414141...")
# -H, --html HTML decodes the data
# -u, --uri URI decodes the data
# --http HTTP decodes the data
# -j, --js JavaScript decodes the data
# -S, --shell Encodes the data as a Shell String
# -P, --powershell Encodes the data as a PowerShell String
+ # --punycode Decodes the data as Punycode
+ # -Q, --quoted-printable Decodes the data as Quoted Printable
# -R, --ruby Ruby decodes the data
+ # --uudecode uudecodes the data
# -x, --xml XML decodes the data
# -h, --help Print help information
#
# ## Arguments
#
# [FILE ...] Optional file(s) to process
#
class Decode < StringMethodsCommand
+ option :base16, desc: 'Base16 decodes the data' do
+ require 'ronin/support/encoding/base16'
+ @method_calls << :base16_decode
+ end
+
option :base32, desc: 'Base32 decodes the data' do
require 'ronin/support/encoding/base32'
@method_calls << :base32_decode
end
@@ -72,10 +83,22 @@
else
@method_calls << :base64_decode
end
end
+ option :zlib, short: '-z',
+ desc: 'Zlib uncompresses the data' do
+ require 'ronin/support/compression/core_ext'
+ @method_calls << :zlib_inflate
+ end
+
+ option :gzip, short: '-g',
+ desc: 'gzip uncompresses the data' do
+ require 'ronin/support/compression/core_ext'
+ @method_calls << :gunzip
+ end
+
option :c, short: '-c',
desc: 'Decodes the data as a C string' do
require 'ronin/support/encoding/c'
@method_calls << :c_decode
end
@@ -119,14 +142,30 @@
desc: 'Decodes the data as a PowerShell String' do
require 'ronin/support/encoding/powershell'
@method_calls << :powershell_decode
end
+ option :punycode, desc: 'Decodes the data as Punycode' do
+ require 'ronin/support/encoding/punycode'
+ @method_calls << :punycode_decode
+ end
+
+ option :quoted_printable, short: '-Q',
+ desc: 'Decodes the data as Quoted Printable' do
+ require 'ronin/support/encoding/quoted_printable'
+ @method_calls << :quoted_printable_decode
+ end
+
option :ruby, short: '-R',
desc: 'Ruby decodes the data' do
require 'ronin/support/encoding/ruby'
@method_calls << :ruby_decode
end
+
+ option :uudecode, desc: 'uudecodes the data' do
+ require 'ronin/support/encoding/uuencoding'
+ @method_calls << :uudecode
+ end
option :xml, short: '-x',
desc: 'XML decodes the data' do
require 'ronin/support/encoding/xml'
@method_calls << :xml_decode