Class: Rex::Proto::DRDA::Packet::PASSWORD_PARAM

Inherits:
Struct
  • Object
show all
Defined in:
lib/rex/proto/drda/packet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ PASSWORD_PARAM

Returns a new instance of PASSWORD_PARAM.



195
196
197
198
199
# File 'lib/rex/proto/drda/packet.rb', line 195

def initialize(args={})
  self[:codepoint] = Rex::Proto::DRDA::Constants::PASSWORD
  self[:payload] = Rex::Text.to_ebcdic(args[:payload].to_s)
  self[:length] = self[:payload].size + 4
end

Instance Attribute Details

#codepointObject

Returns the value of attribute codepoint

Returns:

  • (Object)

    the current value of codepoint



194
195
196
# File 'lib/rex/proto/drda/packet.rb', line 194

def codepoint
  @codepoint
end

#lengthObject

Returns the value of attribute length

Returns:

  • (Object)

    the current value of length



194
195
196
# File 'lib/rex/proto/drda/packet.rb', line 194

def length
  @length
end

#payloadObject

Returns the value of attribute payload

Returns:

  • (Object)

    the current value of payload



194
195
196
# File 'lib/rex/proto/drda/packet.rb', line 194

def payload
  @payload
end

Instance Method Details

#encode(str) ⇒ Object



200
201
202
# File 'lib/rex/proto/drda/packet.rb', line 200

def encode(str)
  Rex::Text.to_ebcdic(str)
end

#to_sObject



203
204
205
# File 'lib/rex/proto/drda/packet.rb', line 203

def to_s
  self.to_a.pack("nna*")
end