def test(): options.parseOptions() ctx = options.getInitContext(rb.getRBlock) ctx[options.CTX.ISA] = False ropts = {} inst = genThumbIT(None, ropts, ctx) print inst
def test_vfp_vector(): # gen_instrs(10) options.parseOptions() ctx = options.getInitContext(getFSM, getRBlock) output = options.getOption("output") exit_b = getVFPExitBlock() testgen.genRandomTest(ctx, output, exitblock=exit_b)
def test(): options.parseOptions() ctx = options.getInitContext(getRBlock) test = getRBlock('rit', 5) blocks = test.makeRandomBlock(ctx) ig.genBlockInstrs(blocks, ctx) print test print blocks, len(blocks)
def main(): """ Main function, this is what runs the game. """ options.parseOptions() game.loadFiles() game.intro() game.run()
def main(): options.parseOptions() #init random seed opt_seed = options.getOption('seed') if opt_seed: random.seed(opt_seed) else: random.seed() ctx = options.getInitContext(rb.getRBlock) tname = options.getOption('output') genTest(ctx, tname) buildTest(tname)
def main(): game = gameengine.Game() options = parseOptions() fGame = open(options.game) gameDesc = json.load(fGame) fGame.close() playerList = [] playerDescs = gameDesc["players"] playerNum = len(playerDescs) for (playerDesc, iPlayer) in zip(playerDescs, range(playerNum)): playerList.append(Client(playerDesc, iPlayer)) game.setClients(playerList, gameDesc) plugin = None try: if options.plugin != "": pluginModule = importlib.import_module("plugins." + options.plugin) plugin = pluginModule.Plugin(game, options.plugin_args) if hasattr(plugin, "__enter__"): with plugin: runGame(game, playerList, options) else: runGame(game, playerList, options) except: # this should not happen in real life, but if you hit Ctrl+C, you probably get here for player in playerList: player.cleanup() print("Game stopped!") raise
def main(): logger.basicConfig(level=logger.DEBUG) logBanner() # mainThread = Thread.currentThread() st = stats_tracker.StatsTracker() stats = st.getInstance() opts = options.parseOptions() try: arch = Architecture.Architecture(opts.sslFilename) except OSError as e: logger.critical('Unable to open SSL file!', e) return except: logger.critical('Error parsing SSL file!', e) return overallStartTime = time.time() _program = program.create_program(arch) mainfile = os.path.abspath(opts.mainFilename) basefilename = None try: logger.warning("Parsing " + opts.mainFilename + "...") _program.load_main_module(mainfile) if basefilename == None: basefilename = get_base_filename(mainfile) except OSError as e: logger.critical('File not found: ', e) return except IOError as e: logger.critical('IOException while parsing executable!', e) return except Exception as e: logger.critical('Error during parsing', e) return logger.info('Finished parsing executable') if opts.startAddress > 0: logger.log("Setting start address to 0x" + hex(opts.startAddress)) _program.set_entry_address( absolute_address(opt.startAddress.getValue()))
from transcode import transDirs from options import parseOptions (options, args) = parseOptions() print("Number of threads requested: {0}".format(options.numThreads)) transDirs(args[0], args[1], options.numThreads)