Class: EFIValidate::EALFRow
- Inherits:
-
Object
- Object
- EFIValidate::EALFRow
- 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
-
#header ⇒ Object
Returns the value of attribute header.
Instance Method Summary collapse
- #core_sec? ⇒ Boolean
- #format_uuid ⇒ Object
- #hash ⇒ Object
- #privacy_row? ⇒ Boolean
- #to_s ⇒ Object
- #uuid ⇒ Object
Instance Attribute Details
#header ⇒ Object
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
30 31 32 |
# File 'lib/efivalidate/ealf_row.rb', line 30 def core_sec? uuid == SEC_CORE end |
#format_uuid ⇒ Object
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 |
#hash ⇒ Object
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
26 27 28 |
# File 'lib/efivalidate/ealf_row.rb', line 26 def privacy_row? ealf_hash.each_byte.all?(&:zero?) end |
#to_s ⇒ Object
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 |
#uuid ⇒ Object
22 23 24 |
# File 'lib/efivalidate/ealf_row.rb', line 22 def uuid UUIDTools::UUID.parse_raw(ealf_uuid) end |