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.
289 290 291 292 293 294 |
# File 'lib/rex/proto/ntlm/base.rb', line 289 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.
288 289 290 |
# File 'lib/rex/proto/ntlm/base.rb', line 288 def active @active end |
Instance Method Details
#data_size ⇒ Object
319 320 321 |
# File 'lib/rex/proto/ntlm/base.rb', line 319 def data_size @active ? @value.size : 0 end |
#parse(str, offset = 0) ⇒ Object
296 297 298 299 300 301 302 303 304 |
# File 'lib/rex/proto/ntlm/base.rb', line 296 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
306 307 308 |
# File 'lib/rex/proto/ntlm/base.rb', line 306 def serialize super if @active end |
#value ⇒ Object
310 311 312 |
# File 'lib/rex/proto/ntlm/base.rb', line 310 def value @value end |
#value=(val) ⇒ Object
314 315 316 317 |
# File 'lib/rex/proto/ntlm/base.rb', line 314 def value=(val) @value = val self.length = self.allocated = val.size end |