Class: Rex::Proto::DRDA::USERID_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 = {}) ⇒ USERID_PARAM

Returns a new instance of USERID_PARAM.



208
209
210
211
212
# File 'lib/rex/proto/drda/packet.rb', line 208

def initialize(args={})
	self[:codepoint] = Constants::USERID
	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



207
208
209
# File 'lib/rex/proto/drda/packet.rb', line 207

def codepoint
  @codepoint
end

#lengthObject

Returns the value of attribute length

Returns:

  • (Object)

    the current value of length



207
208
209
# File 'lib/rex/proto/drda/packet.rb', line 207

def length
  @length
end

#payloadObject

Returns the value of attribute payload

Returns:

  • (Object)

    the current value of payload



207
208
209
# File 'lib/rex/proto/drda/packet.rb', line 207

def payload
  @payload
end

Instance Method Details

#encode(str) ⇒ Object



213
214
215
# File 'lib/rex/proto/drda/packet.rb', line 213

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

#to_sObject



216
217
218
# File 'lib/rex/proto/drda/packet.rb', line 216

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