Class: Msf::Util::DotNetDeserialization::Types::SerializedStream

Inherits:
BinData::Record
  • Object
show all
Defined in:
lib/msf/util/dot_net_deserialization/types.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_values(values) ⇒ Object



86
87
88
89
90
91
92
# File 'lib/msf/util/dot_net_deserialization/types.rb', line 86

def self.from_values(values)
  stream = self.new
  values.each do |contents|
    stream.records << Record.from_value(contents, parent: stream.records)
  end
  stream
end

Instance Method Details

#get_object(id) ⇒ Object



94
95
96
97
98
99
# File 'lib/msf/util/dot_net_deserialization/types.rb', line 94

def get_object(id)
  id = id.value if id.is_a? BinData::BasePrimitive

  @objects ||= {}
  @objects[id]
end

#set_object(id, object) ⇒ Object



101
102
103
104
105
106
# File 'lib/msf/util/dot_net_deserialization/types.rb', line 101

def set_object(id, object)
  id = id.value if id.is_a? BinData::BasePrimitive

  @objects ||= {}
  @objects[id] = object
end