Class: Rex::Proto::DRDA::Packet::DDM_PARAM
- Inherits:
-
Struct
- Object
- Struct
- Rex::Proto::DRDA::Packet::DDM_PARAM
- Defined in:
- lib/rex/proto/drda/packet.rb
Instance Attribute Summary collapse
-
#codepoint ⇒ Object
Returns the value of attribute codepoint.
-
#length ⇒ Object
Returns the value of attribute length.
-
#payload ⇒ Object
Returns the value of attribute payload.
Instance Method Summary collapse
Instance Attribute Details
#codepoint ⇒ Object
Returns the value of attribute codepoint
111 112 113 |
# File 'lib/rex/proto/drda/packet.rb', line 111 def codepoint @codepoint end |
#length ⇒ Object
Returns the value of attribute length
111 112 113 |
# File 'lib/rex/proto/drda/packet.rb', line 111 def length @length end |
#payload ⇒ Object
Returns the value of attribute payload
111 112 113 |
# File 'lib/rex/proto/drda/packet.rb', line 111 def payload @payload end |
Instance Method Details
#read(str = "") ⇒ Object
113 114 115 116 117 118 119 120 121 122 |
# File 'lib/rex/proto/drda/packet.rb', line 113 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 ⇒ Object
124 125 126 |
# File 'lib/rex/proto/drda/packet.rb', line 124 def to_s self.to_a.pack("nna*") end |