Class: Rex::Proto::NTLM::Base::Int16LE
- Defined in:
- lib/rex/proto/ntlm/base.rb
Instance Attribute Summary
Attributes inherited from Field
Instance Method Summary collapse
-
#initialize(opt) ⇒ Int16LE
constructor
A new instance of Int16LE.
- #parse(str, offset = 0) ⇒ Object
- #serialize ⇒ Object
Methods inherited from Field
Constructor Details
#initialize(opt) ⇒ Int16LE
Returns a new instance of Int16LE.
102 103 104 105 |
# File 'lib/rex/proto/ntlm/base.rb', line 102 def initialize(opt) super(opt) @size = 2 end |
Instance Method Details
#parse(str, offset = 0) ⇒ Object
107 108 109 110 111 112 113 114 |
# File 'lib/rex/proto/ntlm/base.rb', line 107 def parse(str, offset=0) if @active and str.size >= offset + @size @value = str[offset, @size].unpack("v")[0] @size else 0 end end |
#serialize ⇒ Object
116 117 118 |
# File 'lib/rex/proto/ntlm/base.rb', line 116 def serialize [@value].pack("v") end |