Class: Rex::Proto::DRDA::Packet::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.



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

def initialize(args={})
  self[:magic] = 0xd0
  self[:format] = 0x41
  self[:correlid] = 1
  self[:codepoint] = Rex::Proto::DRDA::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



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

def codepoint
  @codepoint
end

#correlidObject

Returns the value of attribute correlid

Returns:

  • (Object)

    the current value of correlid



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

def correlid
  @correlid
end

#formatObject

Returns the value of attribute format

Returns:

  • (Object)

    the current value of format



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

def format
  @format
end

#lengthObject

Returns the value of attribute length

Returns:

  • (Object)

    the current value of length



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

def length
  @length
end

#length2Object

Returns the value of attribute length2

Returns:

  • (Object)

    the current value of length2



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

def length2
  @length2
end

#magicObject

Returns the value of attribute magic

Returns:

  • (Object)

    the current value of magic



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

def magic
  @magic
end

#mgrlvllsObject

Returns the value of attribute mgrlvlls

Returns:

  • (Object)

    the current value of mgrlvlls



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

def mgrlvlls
  @mgrlvlls
end

Instance Method Details

#to_sObject



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

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