예제 #1
0
	def __repr__(self):
		if self.type == BranchType.UnresolvedBranch:
			return "<%s>" % BranchType(self.type).name
		elif self.target.arch:
			return "<%s: %s@%#x>" % (BranchType(self.type).name, self.target.arch.name, self.target.start)
		else:
			return "<%s: %#x>" % (BranchType(self.type).name, self.target.start)
예제 #2
0
	def incoming_edges(self):
		"""List of basic block incoming edges (read-only)"""
		count = ctypes.c_ulonglong(0)
		edges = core.BNGetBasicBlockIncomingEdges(self.handle, count)
		result = []
		for i in xrange(0, count.value):
			branch_type = BranchType(edges[i].type)
			if edges[i].target:
				target = self._create_instance(self.view, core.BNNewBasicBlockReference(edges[i].target))
			else:
				target = None
			result.append(BasicBlockEdge(branch_type, target, self, edges[i].backEdge))
		core.BNFreeBasicBlockEdgeList(edges, count.value)
		return result