class Rex::Proto::NTLM::Base::String
Public Class Methods
new(opts)
click to toggle source
Calls superclass method
Rex::Proto::NTLM::Base::Field::new
# File lib/rex/proto/ntlm/base.rb, line 68 def initialize(opts) super(opts) @size = opts[:size] end
Public Instance Methods
parse(str, offset=0)
click to toggle source
# File lib/rex/proto/ntlm/base.rb, line 73 def parse(str, offset=0) if @active and str.size >= offset + @size @value = str[offset, @size] @size else 0 end end
serialize()
click to toggle source
# File lib/rex/proto/ntlm/base.rb, line 82 def serialize if @active @value else "" end end
value=(val)
click to toggle source
# File lib/rex/proto/ntlm/base.rb, line 90 def value=(val) @value = val @size = @value.nil? ? 0 : @value.size @active = (@size > 0) end