class Rex::Proto::DRDA::DDM_PARAM

Public Instance Methods

read(str="") click to toggle source
# File lib/rex/proto/drda/packet.rb, line 112
def read(str="")
  raise DRDA::Error, "Input isn't a String." if !str.kind_of? String
  raise DRDA::RespError, "DDM_PARAM is too short" if str.size < 4
  (self[:length], self[:codepoint]) =
    str.unpack("nn")
  raise DRDA::RespError, "DDM_PARAM Length is too short" if self[:length] < 4
  rest = str[4,self[:length]-4] # If it's negative or whatever, it'll end up as "".
  self[:payload] = rest.to_s[0,self[:length]-4]
  return self
end
to_s() click to toggle source
# File lib/rex/proto/drda/packet.rb, line 123
def to_s
  self.to_a.pack("nna*")
end