Class: Rex::Proto::NTLM::Base::SecurityBuffer
- Inherits:
-
Object
- Object
- Rex::Proto::NTLM::Base::SecurityBuffer
- Defined in:
- lib/rex/proto/ntlm/base.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
Instance Method Summary collapse
- #data_size ⇒ Object
-
#initialize(opts) ⇒ SecurityBuffer
constructor
A new instance of SecurityBuffer.
- #parse(str, offset = 0) ⇒ Object
- #serialize ⇒ Object
- #value ⇒ Object
- #value=(val) ⇒ Object
Constructor Details
#initialize(opts) ⇒ SecurityBuffer
Returns a new instance of SecurityBuffer.
290 291 292 293 294 295 |
# File 'lib/rex/proto/ntlm/base.rb', line 290 def initialize(opts) super() @value = opts[:value] @active = opts[:active].nil? ? true : opts[:active] @size = 8 end |
Instance Attribute Details
#active ⇒ Object
Returns the value of attribute active.
289 290 291 |
# File 'lib/rex/proto/ntlm/base.rb', line 289 def active @active end |
Instance Method Details
#data_size ⇒ Object
320 321 322 |
# File 'lib/rex/proto/ntlm/base.rb', line 320 def data_size @active ? @value.size : 0 end |
#parse(str, offset = 0) ⇒ Object
297 298 299 300 301 302 303 304 305 |
# File 'lib/rex/proto/ntlm/base.rb', line 297 def parse(str, offset=0) if @active and str.size >= offset + @size super(str, offset) @value = str[self.offset, self.length] @size else 0 end end |
#serialize ⇒ Object
307 308 309 |
# File 'lib/rex/proto/ntlm/base.rb', line 307 def serialize super if @active end |
#value ⇒ Object
311 312 313 |
# File 'lib/rex/proto/ntlm/base.rb', line 311 def value @value end |
#value=(val) ⇒ Object
315 316 317 318 |
# File 'lib/rex/proto/ntlm/base.rb', line 315 def value=(val) @value = val self.length = self.allocated = val.size end |