Esempio n. 1
0
	def _show_graph_report(self, ctxt, view, title, graph):
		try:
			if view:
				view = binaryview.BinaryView(handle = core.BNNewViewReference(view))
			else:
				view = None
			self.show_graph_report(view, title, flowgraph.CoreFlowGraph(core.BNNewFlowGraphReference(graph)))
		except:
			log.log_error(traceback.format_exc())
Esempio n. 2
0
	def _report_from_index(self, i):
		report_type = core.BNGetReportType(self.handle, i)
		title = core.BNGetReportTitle(self.handle, i)
		view = core.BNGetReportView(self.handle, i)
		if view:
			view = binaryview.BinaryView(handle = view)
		else:
			view = None
		if report_type == ReportType.PlainTextReportType:
			contents = core.BNGetReportContents(self.handle, i)
			return PlainTextReport(title, contents, view)
		elif report_type == ReportType.MarkdownReportType:
			contents = core.BNGetReportContents(self.handle, i)
			plaintext = core.BNGetReportPlainText(self.handle, i)
			return MarkdownReport(title, contents, plaintext, view)
		elif report_type == ReportType.HTMLReportType:
			contents = core.BNGetReportContents(self.handle, i)
			plaintext = core.BNGetReportPlainText(self.handle, i)
			return HTMLReport(title, contents, plaintext, view)
		elif report_type == ReportType.FlowGraphReportType:
			graph = flowgraph.CoreFlowGraph(core.BNGetReportFlowGraph(self.handle, i))
			return FlowGraphReport(title, graph, view)
		raise TypeError("invalid report type %s" % repr(report_type))