2012-06-29 05:18:28 +00:00
|
|
|
# -*- coding: binary -*-
|
2012-01-11 00:45:24 +00:00
|
|
|
module Rex
|
|
|
|
module Registry
|
|
|
|
|
|
|
|
class RegfBlock
|
2012-02-03 23:01:35 +00:00
|
|
|
|
|
|
|
attr_accessor :timestamp, :root_key_offset
|
2012-01-11 00:45:24 +00:00
|
|
|
|
|
|
|
def initialize(hive)
|
2012-02-03 23:01:35 +00:00
|
|
|
|
2012-01-11 00:45:24 +00:00
|
|
|
regf_header = hive[0x00, 4]
|
2012-02-03 23:01:35 +00:00
|
|
|
|
2012-01-11 00:45:24 +00:00
|
|
|
if regf_header !~ /regf/
|
|
|
|
puts "Not a registry hive"
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
|
|
|
@timestamp = hive[0x0C, 8].unpack('q').first
|
|
|
|
@root_key_offset = 0x20
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|