metasploit-framework/lib/rex/registry/valuelist.rb

30 lines
517 B
Ruby
Raw Normal View History

# -*- coding: binary -*-
2012-01-11 00:45:24 +00:00
require_relative "valuekey"
module Rex
module Registry
class ValueList
2012-05-24 23:10:26 +00:00
attr_accessor :values
2012-01-11 00:45:24 +00:00
def initialize(hive, offset, number_of_values)
2012-05-24 23:10:26 +00:00
offset = offset + 4
2012-01-11 00:45:24 +00:00
inner_offset = 0
@values = []
1.upto(number_of_values) do |v|
2012-01-16 23:54:33 +00:00
valuekey_offset = hive[offset + inner_offset, 4]
next if !valuekey_offset
valuekey_offset = valuekey_offset.unpack('l').first
2012-01-11 00:45:24 +00:00
@values << ValueKey.new(hive, valuekey_offset + 0x1000)
inner_offset = inner_offset + 4
end
end
end
end
end