Mercurial > lcfOS
view python/bcanalyzer.py @ 181:216da5e46efc
Changed indent to 4 spaces to comply to convention
author | Windel Bouwman |
---|---|
date | Sat, 18 May 2013 17:45:26 +0200 |
parents | 6a303f835c6d |
children |
line wrap: on
line source
#!/usr/bin/python import sys, os, argparse from ppci.core import BitcodeReader if __name__ == '__main__': parser = argparse.ArgumentParser(description='Bitcode analyzer') parser.add_argument('bitcodefile', type=str, help='the bitcode file to analyze') args = parser.parse_args() try: with open(args.bitcodefile, 'rb') as f: bcr = BitcodeReader(f) module = bcr.parseModule() except IOError: print('Failed to load {0}'.format(args.bitcodefile)) sys.exit(3) print(module)