From 1b69efce702fe0bcff97fcea0078d35b781fa299 Mon Sep 17 00:00:00 2001 From: Eli Bendersky Date: Tue, 20 Dec 2011 06:45:00 +0200 Subject: [PATCH] some doc updates --- elftools/elf/elffile.py | 3 +++ z.py | 9 ++------- 2 files changed, 5 insertions(+), 7 deletions(-) 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 -- 2.30.2