Class: EFIValidate::EALFRow

Inherits:
Object
  • Object
show all
Defined in:
lib/efivalidate/ealf_row.rb

Overview

A class that represents a region of an EFI firmware with a valid hash for the region

A EALF file is a collection of regions an

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#headerObject

Returns the value of attribute header.



16
17
18
# File 'lib/efivalidate/ealf_row.rb', line 16

def header
  @header
end

Instance Method Details

#core_sec?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/efivalidate/ealf_row.rb', line 30

def core_sec?
  uuid == SEC_CORE
end

#format_uuidObject



38
39
40
# File 'lib/efivalidate/ealf_row.rb', line 38

def format_uuid
  format '%36.36s', (EFIValidate::ROW_GUIDS[uuid.to_s] || uuid)
end

#hashObject



18
19
20
# File 'lib/efivalidate/ealf_row.rb', line 18

def hash
  ealf_hash.each_byte.map { |b| '%02x' % b }.join
end

#privacy_row?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/efivalidate/ealf_row.rb', line 26

def privacy_row?
  ealf_hash.each_byte.all?(&:zero?)
end

#to_sObject



34
35
36
# File 'lib/efivalidate/ealf_row.rb', line 34

def to_s
  format '<%02x:%02x:%04x:%08x:%08x:%s:%s>', ealf_component, ealf_region, ealf_master, ealf_offset, ealf_length, format_uuid, hash
end

#uuidObject



22
23
24
# File 'lib/efivalidate/ealf_row.rb', line 22

def uuid
  UUIDTools::UUID.parse_raw(ealf_uuid)
end