Class: Ronin::Encoders::Encoder

Inherits:
Object
  • Object
show all
Includes:
Model::TargetsArch, Model::TargetsOS, Script
Defined in:
lib/ronin/encoders/encoder.rb

Direct Known Subclasses

XOR

Instance Method Summary collapse

Methods included from Model::TargetsOS

included

Methods included from Model::TargetsArch

included

Instance Method Details

#encode(data) ⇒ String

Default method which will encode data.

Parameters:

  • data (String)

    The data to be encoded.

Returns:

  • (String)

    The encoded data.

Since:

  • 1.0.0


50
51
52
# File 'lib/ronin/encoders/encoder.rb', line 50

def encode(data)
  data
end

#inspectString

Inspects the contents of the payload encoder.

Returns:

  • (String)

    The inspected encoder.

Since:

  • 1.0.0


74
75
76
77
78
79
# File 'lib/ronin/encoders/encoder.rb', line 74

def inspect
  str = "#{self.class}: #{self}"
  str << " #{self.params.inspect}" unless self.params.empty?

  return "#<#{str}>"
end

#to_sString

Converts the encoder to a String.

Returns:

  • (String)

    The name of the payload encoder.

Since:

  • 1.0.0


62
63
64
# File 'lib/ronin/encoders/encoder.rb', line 62

def to_s
  self.name.to_s
end