some doc updates
authorEli Bendersky <eliben@gmail.com>
Tue, 20 Dec 2011 04:45:00 +0000 (06:45 +0200)
committerEli Bendersky <eliben@gmail.com>
Tue, 20 Dec 2011 04:45:00 +0000 (06:45 +0200)
elftools/elf/elffile.py
z.py

index 32cf63195443bb0a56b17eecaf16e67bffddf56d..0f642da765d88375447febea7911d0c9ae517867 100644 (file)
@@ -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 e77d90316ad82a2387b985a63e40d75edde7558c..e5f26b7c627e0ef126686ce53597f33db9bb08c2 100644 (file)
--- 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