[docs]def__init__(self,content,func_graph=None,cc=None):""" The thing being analysed, and the way (visitor) to analyse it. :param Union[ailment.Block, angr.Block, Function] content: Thing to be analysed. :param networkx.DiGraph func_graph: Alternative graph for function.graph. :param SimCC cc: Calling convention of the function. """self._content=contentifisinstance(content,Function):self._cc=ccorcontent.calling_conventionself._func_graph=func_graphself._type=SubjectType.Functionself._visitor=FunctionGraphVisitor(content,func_graph)elifisinstance(content,(ailment.Block,Block)):self._type=SubjectType.Blockself._visitor=SingleNodeGraphVisitor(content)else:raiseTypeError("Unsupported analysis target.")
@propertydefcc(self):ifself.typenotin(SubjectType.Function,SubjectType.CallTrace):raiseTypeError("There are no `cc` attribute for <%s>."%self.type)returnself._cc@propertydefcontent(self):returnself._content@propertydeffunc_graph(self):ifself.typeisnotSubjectType.Function:raiseTypeError("There are no `func_graph` attribute for <%s>."%self.type)returnself._func_graph@propertydeftype(self):returnself._type@propertydefvisitor(self)->Union[FunctionGraphVisitor,SingleNodeGraphVisitor]:returnself._visitor