Class: Elf

Inherits:
Object
  • Object
show all
Defined in:
lib/elfcat/elf.rb

Instance Method Summary collapse

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_headerObject



8
9
10
# File 'lib/elfcat/elf.rb', line 8

def file_header
  @file_header ||= FileHeader.new
end

#program_headerObject



16
17
18
# File 'lib/elfcat/elf.rb', line 16

def program_header
  @program_header ||= ProgramHeader.new(file_header, section_table_with_names)
end

#resourceObject



12
13
14
# File 'lib/elfcat/elf.rb', line 12

def resource
  return $resource
end

#section_namesObject



24
25
26
# File 'lib/elfcat/elf.rb', line 24

def section_names
  @section_names ||= SectionName.new(file_header, section_table)
end

#section_tableObject



20
21
22
# File 'lib/elfcat/elf.rb', line 20

def section_table
  @section_table ||= SectionTable.new(file_header)
end

#section_table_with_namesObject



28
29
30
# File 'lib/elfcat/elf.rb', line 28

def section_table_with_names
  section_table.populate(section_names)
end

#string_tableObject



32
33
34
# File 'lib/elfcat/elf.rb', line 32

def string_table
  @string_table ||= StringTable.new(section_table_with_names)
end