debug_line_sec=debug_sections['.debug_line'])
def get_machine_arch(self):
+ """ Return the machine architecture, as detected from the ELF header.
+ At the moment the only supported architectures are x86 and x64.
+ """
if self['e_machine'] == 'EM_X86_64':
return 'x64'
elif self['e_machine'] in ('EM_386', 'EM_486'):
from elftools.elf.relocation import *
-stream = open('tests/testfiles/exe_simple64.elf', 'rb')
-#stream = open('binfiles/z32.elf', 'rb')
+stream = open('test/testfiles/exe_simple64.elf', 'rb')
efile = ELFFile(stream)
print 'elfclass', efile.elfclass
print '===> %s sections!' % efile.num_sections()
-
-#~ print efile.has_dwarf_info()
-
-dwarfinfo = efile.get_dwarf_info()
-cfi_entries = dwarfinfo.CFI_entries()
+print efile.header