def handle(self, *args, **options): # Parse the ExecutionTracer.dat file(s) and generate an execution tree # for the given path IDs results_dir = self.project_path('s2e-last') execution_tree = parse_execution_tree(results_dir, path_ids=options['path_ids']) if not execution_tree: raise CommandError('The execution trace is empty') # Convert the tree into a JSON representation state = AnalyzerState() execution_tree_json = _make_json_trace(execution_tree, state) # Write the execution tree to a JSON file json_trace_file = self.project_path('s2e-last', 'execution_trace.json') with open(json_trace_file, 'w', encoding='utf-8') as f: if options['pretty_print']: json.dump(execution_tree_json, f, indent=4, sort_keys=True, cls=TraceEncoder) else: json.dump(execution_tree_json, f, cls=TraceEncoder) logger.success('Execution trace saved to %s', json_trace_file)
def handle(self, *args, **options): # Parse the ExecutionTracer.dat file(s) and generate an execution tree # for the given path IDs results_dir = self.project_path('s2e-last') execution_tree = parse_execution_tree(results_dir) if not execution_tree: raise CommandError('The execution trace is empty') syms = SymbolManager(self.install_path(), self.symbol_search_path) fp = ForkProfiler(execution_tree, syms) fp.get() fp.dump()
def handle(self, *args, **options): # Parse the ExecutionTracer.dat file(s) and generate an execution tree # for the given path IDs results_dir = self.project_path('s2e-last') execution_tree = parse_execution_tree(results_dir, path_ids=options['path_ids']) if not execution_tree: raise CommandError('The execution trace is empty') # Convert the tree into a JSON representation execution_tree_json = _make_json_trace(execution_tree) # Write the execution tree to a JSON file json_trace_file = self.project_path('s2e-last', 'execution_trace.json') with open(json_trace_file, 'w') as f: json.dump(execution_tree_json, f) logger.success('Execution trace saved to %s', json_trace_file)