def valid_elf_file?(path)
      # A light-weight way to check if is a valid ELF file
      # Checks at least one phdr should present.
      File.open(path) { |f| ELFTools::ELFFile.new(f).each_segments.first }
      true
    rescue ELFTools::ELFError
      false
    end
def valid_elf_file?(path)
      # A light-weight way to check if is a valid ELF file
      # Checks at least one phdr should present.
      File.open(path) { |f| ELFTools::ELFFile.new(f).each_segments.first }
      true
    rescue ELFTools::ELFError
      false
    end
Checks if the file of given path is a valid ELF file.

 @param [String] path Path to target file.
 @return [Boolean] If the file is an ELF or not.
 @example
   Helper.valid_elf_file?('/etc/passwd')
   #=> false
   Helper.valid_elf_file?('/lib64/ld-linux-x86-64.so.2')
   #=> true