Module: RubySMB::NTLM::Message

Defined in:
lib/ruby_smb/ntlm/client.rb

Instance Method Summary collapse

Instance Method Details

#deflagObject



3
4
5
6
7
8
9
# File 'lib/ruby_smb/ntlm/client.rb', line 3

def deflag
  security_buffers.inject(head_size) do |cur, a|
    a[1].offset = cur
    cur += a[1].data_size
    has_flag?(:UNICODE) ? cur + cur % 2 : cur
  end
end

#serializeObject



11
12
13
14
# File 'lib/ruby_smb/ntlm/client.rb', line 11

def serialize
  deflag
  @alist.map { |n, f| f.serialize }.join + security_buffers.map { |n, f| f.value + (has_flag?(:UNICODE) ? "\x00".b * (f.value.length % 2) : '') }.join
end