view python/readelf.py @ 122:aaa4939a7942

Improved repostats
author Windel Bouwman
date Sat, 12 Jan 2013 12:49:27 +0100
parents db8aafe00d27
children bbf4c9b138d4
line wrap: on
line source

#!/usr/bin/python

import elffile, argparse

parser = argparse.ArgumentParser()
parser.add_argument('file', type=argparse.FileType('rb'))
parser.add_argument('-l', action='store_const', const=True, default=False, dest='list_program_headers')

args = parser.parse_args()
print(args)
ef = elffile.ElfFile(args.file)
print(ef)

if args.list_program_headers:
   print('program headers')
   ef.printProgramHeaders()