Class: Rex::Proto::DRDA::EXCSAT_DDM

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

Overview

Currently, only takes a MGRLVLLS param. Extend the struct when more parameters are defined.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ EXCSAT_DDM

Returns a new instance of EXCSAT_DDM.



30
31
32
33
34
35
36
37
38
# File 'lib/rex/proto/drda/packet.rb', line 30

def initialize(args={})
	self[:magic] = 0xd0
	self[:format] = 0x41
	self[:correlid] = 1
	self[:codepoint] = Constants::EXCSAT
	self[:mgrlvlls] = args[:mgrlvlls] || MGRLVLLS_PARAM.new.to_s
	self[:length] = (10 + self[:mgrlvlls].to_s.size)
	self[:length2] = self[:length]-6 
end

Instance Attribute Details

#codepointObject

Returns the value of attribute codepoint

Returns:

  • (Object)

    the current value of codepoint



27
28
29
# File 'lib/rex/proto/drda/packet.rb', line 27

def codepoint
  @codepoint
end

#correlidObject

Returns the value of attribute correlid

Returns:

  • (Object)

    the current value of correlid



27
28
29
# File 'lib/rex/proto/drda/packet.rb', line 27

def correlid
  @correlid
end

#formatObject

Returns the value of attribute format

Returns:

  • (Object)

    the current value of format



27
28
29
# File 'lib/rex/proto/drda/packet.rb', line 27

def format
  @format
end

#lengthObject

Returns the value of attribute length

Returns:

  • (Object)

    the current value of length



27
28
29
# File 'lib/rex/proto/drda/packet.rb', line 27

def length
  @length
end

#length2Object

Returns the value of attribute length2

Returns:

  • (Object)

    the current value of length2



27
28
29
# File 'lib/rex/proto/drda/packet.rb', line 27

def length2
  @length2
end

#magicObject

Returns the value of attribute magic

Returns:

  • (Object)

    the current value of magic



27
28
29
# File 'lib/rex/proto/drda/packet.rb', line 27

def magic
  @magic
end

#mgrlvllsObject

Returns the value of attribute mgrlvlls

Returns:

  • (Object)

    the current value of mgrlvlls



27
28
29
# File 'lib/rex/proto/drda/packet.rb', line 27

def mgrlvlls
  @mgrlvlls
end

Instance Method Details

#to_sObject



40
41
42
43
44
# File 'lib/rex/proto/drda/packet.rb', line 40

def to_s
	packstr = "nCCnnn"
	packstr += "a*"  # Pack smarter as more params are added.
	self.to_a.pack(packstr)
end