Method: ELFTools::ELFFile#elf_type

Defined in:
lib/elftools/elf_file.rb

#elf_typeString

Return the ELF type according to e_type.

Examples:

ELFFile.new(File.open('spec/files/libc.so.6')).elf_type
#=> 'DYN'
ELFFile.new(File.open('spec/files/amd64.elf')).elf_type
#=> 'EXEC'

Returns:

  • (String)

    Type in string format.



82
83
84
# File 'lib/elftools/elf_file.rb', line 82

def elf_type
  ELFTools::Constants::ET.mapping(header.e_type)
end