def architecture(file)
      return :invalid unless File.exist?(file)

      f = File.open(file)
      str = ELFTools::ELFFile.new(f).machine
      {
        'Advanced Micro Devices X86-64' => :amd64,
        'Intel 80386' => :i386,
        'ARM' => :arm,
        'AArch64' => :aarch64,
        'MIPS R3000' => :mips
      }[str] || :unknown
    rescue ELFTools::ELFError # not a valid ELF
      :invalid
    ensure
      f&.close
    end
def architecture(file)
      return :invalid unless File.exist?(file)

      f = File.open(file)
      str = ELFTools::ELFFile.new(f).machine
      {
        'Advanced Micro Devices X86-64' => :amd64,
        'Intel 80386' => :i386,
        'ARM' => :arm,
        'AArch64' => :aarch64,
        'MIPS R3000' => :mips
      }[str] || :unknown
    rescue ELFTools::ELFError # not a valid ELF
      :invalid
    ensure
      f&.close
    end
Fetch the ELF archiecture of +file+.
 @param [String] file The target ELF filename.
 @return [Symbol]
   Currently supports amd64, i386, arm, aarch64, and mips.
 @example
   Helper.architecture('/bin/cat')
   #=> :amd64