Class: Rex::Registry::LFBlock

Inherits:
Object
  • Object
show all
Defined in:
lib/rex/registry/lfkey.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hive_blob, offset) ⇒ LFBlock

Returns a new instance of LFBlock


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/rex/registry/lfkey.rb', line 11

def initialize(hive_blob, offset)
  offset = offset + 4
  lf_header = hive_blob[offset, 2]

  if lf_header !~ /lf/ && lf_header !~ /lh/
    return
  end

  @number_of_keys = hive_blob[offset + 0x02, 2].unpack('C').first

  @hash_records = []
  @children = []

  hash_offset = offset + 0x04

  1.upto(@number_of_keys) do |h|

    hash = LFHashRecord.new(hive_blob, hash_offset)

    @hash_records << hash

    hash_offset = hash_offset + 0x08

    @children << NodeKey.new(hive_blob, hash.nodekey_offset + 0x1000)
  end
end

Instance Attribute Details

#childrenObject

Returns the value of attribute children


9
10
11
# File 'lib/rex/registry/lfkey.rb', line 9

def children
  @children
end

#hash_recordsObject

Returns the value of attribute hash_records


9
10
11
# File 'lib/rex/registry/lfkey.rb', line 9

def hash_records
  @hash_records
end

#number_of_keysObject

Returns the value of attribute number_of_keys


9
10
11
# File 'lib/rex/registry/lfkey.rb', line 9

def number_of_keys
  @number_of_keys
end