Class: Watobo::NTLM::Int64LE
Instance Attribute Summary
Attributes inherited from Field
Instance Method Summary collapse
-
#initialize(opt) ⇒ Int64LE
constructor
A new instance of Int64LE.
- #parse(str, offset = 0) ⇒ Object
- #serialize ⇒ Object
Methods inherited from Field
Constructor Details
#initialize(opt) ⇒ Int64LE
Returns a new instance of Int64LE.
395 396 397 398 |
# File 'lib/watobo/utils/ntlm.rb', line 395 def initialize(opt) super(opt) @size = 8 end |
Instance Method Details
#parse(str, offset = 0) ⇒ Object
400 401 402 403 404 405 406 407 408 |
# File 'lib/watobo/utils/ntlm.rb', line 400 def parse(str, offset=0) if @active and str.size >= offset + @size d, u = str.slice(offset, @size).unpack("V2") @value = (u * 0x100000000 + d) @size else 0 end end |
#serialize ⇒ Object
410 411 412 |
# File 'lib/watobo/utils/ntlm.rb', line 410 def serialize [@value & 0x00000000ffffffff, @value >> 32].pack("V2") if @active end |