blob: 3b2c80637803eb78ec48c5214868929d8a12ba0d [file] [log] [blame]
# elftools example:
# Show the names of all .debug_* sections in ELF files.
# Eli Bendersky (
# This code is in the public domain
from __future__ import print_function
import sys
# If elftools is not installed, maybe we're running from the root or examples
# dir of the source distribution
import elftools
except ImportError:
sys.path.extend(['.', '..'])
from elftools.elf.elffile import ELFFile
def process_file(filename):
print('In file:', filename)
with open(filename) as f:
elffile = ELFFile(f)
for section in elffile.iter_sections():
print(' ' +
if __name__ == '__main__':
for filename in sys.argv[1:]: