Mercurial > lcfOS
view python/readelf.py @ 119:f51791638cae
Simplified flashing
author | Windel Bouwman |
---|---|
date | Sat, 12 Jan 2013 10:23:33 +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()