Module: Msf::Util::DotNetDeserialization::Types::RecordArray::ReadRecordsUntilPlugin

Defined in:
lib/msf/util/dot_net_deserialization/types.rb

Overview

Allow reading records until either EoF or the last record type is MessageEnd

Instance Method Summary collapse

Instance Method Details

#do_read(io) ⇒ Object


58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/msf/util/dot_net_deserialization/types.rb', line 58

def do_read(io)
  loop do
    element = append_new_element
    begin
      element.do_read(io)
    rescue EOFError, IOError
      elements.pop
      break
    end

    break if elements[-1].record_type == Enums::RecordTypeEnum[:MessageEnd]
  end
end