Class: Resilience::BootTable

Inherits:
Object
  • Object
show all
Includes:
OnImage
Defined in:
lib/resilience/tables/boot.rb

Direct Known Subclasses

GPT, MBR

Constant Summary collapse

SECTOR_SIZE =
0x200

Instance Method Summary collapse

Methods included from OnImage

#image, image, included, restore_pos, #restore_pos, store_pos, #store_pos

Instance Method Details

#refs_offsetObject



23
24
25
# File 'lib/resilience/tables/boot.rb', line 23

def refs_offset
  refs_offsets.first
end

#refs_offsetsObject



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/resilience/tables/boot.rb', line 11

def refs_offsets
  offsets = []
  fs_off = fs_offsets
  image.offset = 0
  fs_off.each do |address|
    image.seek address
    sig = image.read(FS_SIGNATURE.size).unpack('C*')
    offsets << address if sig == FS_SIGNATURE
  end
  offsets
end