Class: Elf
- Inherits:
-
Object
- Object
- Elf
- Defined in:
- lib/elfcat/elf.rb
Instance Method Summary collapse
- #file_header ⇒ Object
-
#initialize(_filepath) ⇒ Elf
constructor
A new instance of Elf.
- #program_header ⇒ Object
- #resource ⇒ Object
- #section_names ⇒ Object
- #section_table ⇒ Object
- #section_table_with_names ⇒ Object
- #string_table ⇒ Object
Constructor Details
#initialize(_filepath) ⇒ Elf
Returns a new instance of Elf.
2 3 4 5 6 |
# File 'lib/elfcat/elf.rb', line 2 def initialize _filepath $resource = File.binread _filepath return self end |
Instance Method Details
#file_header ⇒ Object
8 9 10 |
# File 'lib/elfcat/elf.rb', line 8 def file_header @file_header ||= FileHeader.new end |
#program_header ⇒ Object
16 17 18 |
# File 'lib/elfcat/elf.rb', line 16 def program_header @program_header ||= ProgramHeader.new(file_header, section_table_with_names) end |
#resource ⇒ Object
12 13 14 |
# File 'lib/elfcat/elf.rb', line 12 def resource return $resource end |
#section_names ⇒ Object
24 25 26 |
# File 'lib/elfcat/elf.rb', line 24 def section_names @section_names ||= SectionName.new(file_header, section_table) end |
#section_table ⇒ Object
20 21 22 |
# File 'lib/elfcat/elf.rb', line 20 def section_table @section_table ||= SectionTable.new(file_header) end |
#section_table_with_names ⇒ Object
28 29 30 |
# File 'lib/elfcat/elf.rb', line 28 def section_table_with_names section_table.populate(section_names) end |
#string_table ⇒ Object
32 33 34 |
# File 'lib/elfcat/elf.rb', line 32 def string_table @string_table ||= StringTable.new(section_table_with_names) end |