From: Eli Bendersky Date: Tue, 20 Dec 2011 04:45:00 +0000 (+0200) Subject: some doc updates X-Git-Tag: v0.10~18 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1b69efce702fe0bcff97fcea0078d35b781fa299;p=pyelftools.git some doc updates --- diff --git a/elftools/elf/elffile.py b/elftools/elf/elffile.py index 32cf631..0f642da 100644 --- a/elftools/elf/elffile.py +++ b/elftools/elf/elffile.py @@ -144,6 +144,9 @@ class ELFFile(object): 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'): diff --git a/z.py b/z.py index e77d903..e5f26b7 100644 --- a/z.py +++ b/z.py @@ -10,14 +10,9 @@ from elftools.elf.sections import * 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