def describe_e_type(x):
return _DESCR_E_TYPE.get(x, _unknown())
+def describe_e_machine(x):
+ return _DESCR_E_MACHINE.get(x, _unknown())
+
+def describe_e_version_numeric(x):
+ return '0x%x' % ENUM_E_VERSION[x]
+
#-------------------------------------------------------------------------------
def _unknown():
PROC_SPECIFIC='Processor Specific',
)
+_DESCR_E_MACHINE = dict(
+ EM_NONE='None',
+ EM_M32='WE32100',
+ EM_SPARC='Sparc',
+ EM_386='Intel 80386',
+ EM_68K='MC68000',
+ EM_88K='MC88000',
+ EM_860='Intel 80860',
+ EM_MIPS='MIPS R3000',
+ EM_S370='IBM System/370',
+ EM_MIPS_RS4_BE='MIPS 4000 big-endian',
+ EM_IA_64='Intel IA-64',
+ EM_X86_64='Advanced Micro Devices X86-64',
+ EM_AVR='Atmel AVR 8-bit microcontroller',
+ RESERVED='RESERVED',
+)
from elftools.elf.elffile import ELFFile
from elftools.elf.descriptions import (
describe_ei_class, describe_ei_data, describe_ei_version,
- describe_ei_osabi, describe_e_type,
+ describe_ei_osabi, describe_e_type, describe_e_machine,
+ describe_e_version_numeric,
)
e_ident['EI_ABIVERSION'])
self._emitline(' Type: %s' %
describe_e_type(header['e_type']))
+ self._emitline(' Machine: %s' %
+ describe_e_machine(header['e_machine']))
+ self._emitline(' Version: %s' %
+ describe_e_version_numeric(header['e_version']))
def _emit(self, s):
""" Emit an object to output