MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / _report_from_index

Method _report_from_index

python/interaction.py:977–999  ·  view source on GitHub ↗
(self, i)

Source from the content-addressed store, hash-verified

975 return core.BNGetReportCollectionCount(self.handle)
976
977 def _report_from_index(self, i):
978 report_type = core.BNGetReportType(self.handle, i)
979 title = core.BNGetReportTitle(self.handle, i)
980 view = core.BNGetReportView(self.handle, i)
981 if view:
982 view = binaryview.BinaryView(handle=view)
983 else:
984 view = None
985 if report_type == ReportType.PlainTextReportType:
986 contents = core.BNGetReportContents(self.handle, i)
987 return PlainTextReport(title, contents, view)
988 elif report_type == ReportType.MarkdownReportType:
989 contents = core.BNGetReportContents(self.handle, i)
990 plaintext = core.BNGetReportPlainText(self.handle, i)
991 return MarkdownReport(title, contents, plaintext, view)
992 elif report_type == ReportType.HTMLReportType:
993 contents = core.BNGetReportContents(self.handle, i)
994 plaintext = core.BNGetReportPlainText(self.handle, i)
995 return HTMLReport(title, contents, plaintext, view)
996 elif report_type == ReportType.FlowGraphReportType:
997 graph = flowgraph.CoreFlowGraph(core.BNGetReportFlowGraph(self.handle, i))
998 return FlowGraphReport(title, graph, view)
999 raise TypeError("invalid report type %s" % repr(report_type))
1000
1001 def __getitem__(self, i):
1002 if isinstance(i, slice) or isinstance(i, tuple):

Callers 2

__getitem__Method · 0.95
__iter__Method · 0.95

Calls 6

PlainTextReportClass · 0.85
MarkdownReportClass · 0.85
HTMLReportClass · 0.85
FlowGraphReportClass · 0.85
BinaryViewMethod · 0.80
CoreFlowGraphMethod · 0.80

Tested by

no test coverage detected