(self, graph, dst_run, dst_stmt_idx, direction='backward', project=None, cfg=None, ignore_sp=False,
                 ignore_bp=False, ignored_regs=None, max_level=3, base_state=None, stop_at_calls=False,
                 cross_insn_opt=False)
:param networkx.DiGraph graph:  A graph representing the control flow graph. Note that it does not take
                                        angr.analyses.CFGEmulated or angr.analyses.CFGFast.
        :param int dst_run:             An address specifying the target SimRun.
        :param int dst_stmt_idx:        The target statement index. -1 means executing until the last statement.
        :param str direction:           'backward' or 'forward' slicing. Forward slicing is not yet supported.
        :param angr.Project project:    The project instance.
        :param angr.analyses.CFGBase cfg: the CFG instance. It will be made mandatory later.
        :param bool ignore_sp:          Whether the stack pointer should be ignored in dependency tracking. Any
                                        dependency from/to stack pointers will be ignored if this options is True.
        :param bool ignore_bp:          Whether the base pointer should be ignored or not.
        :param int  max_level:          The maximum number of blocks that we trace back for.
        :param int stop_at_calls:       Limit slicing within a single function. Do not proceed when encounters a call
                                        edge.
        :return: None
:param networkx.DiGraph graph:  A graph representing the control flow graph. Note that it does not take
                                        angr.analyses.CFGEmulated or angr.analyses.CFGFast.
        :param int dst_run:             An address specifying the target SimRun.
        :param int dst_stmt_idx:        The target statement index. -1 means executing until the last statement.
        :param str direction:           'backward' or 'forward' slicing. Forward slicing is not yet supported.
        :param angr.Project project:    The project instance.
        :param angr.analyses.CFGBase cfg: the CFG instance. It will be made mandatory later.
        :param bool ignore_sp:          Whether the stack pointer should be ignored in dependency tracking. Any
                                        dependency from/to stack pointers will be ignored if this options is True.
        :param bool ignore_bp:          Whether the base pointer should be ignored or not.
        :param int  max_level:          The maximum number of blocks that we trace back for.
        :param int stop_at_calls:       Limit slicing within a single function. Do not proceed when encounters a call
                                        edge.
        :return: None
: param networkx . DiGraph graph : A graph representing the control flow graph . Note that it does not take angr . analyses . CFGEmulated or angr . analyses . CFGFast . : param int dst_run : An address specifying the target SimRun . : param int dst_stmt_idx : The target statement index . - 1 means executing until the last statement . : param str direction : backward or forward slicing . Forward slicing is not yet supported . : param angr . Project project : The project instance . : param angr . analyses . CFGBase cfg : the CFG instance . It will be made mandatory later . : param bool ignore_sp : Whether the stack pointer should be ignored in dependency tracking . Any dependency from / to stack pointers will be ignored if this options is True . : param bool ignore_bp : Whether the base pointer should be ignored or not . : param int max_level : The maximum number of blocks that we trace back for . : param int stop_at_calls : Limit slicing within a single function . Do not proceed when encounters a call edge . : return : None
def __init__(self, graph, dst_run, dst_stmt_idx, direction='backward', project=None, cfg=None, ignore_sp=False,
                 ignore_bp=False, ignored_regs=None, max_level=3, base_state=None, stop_at_calls=False,
                 cross_insn_opt=False):
        """
        :param networkx.DiGraph graph:  A graph representing the control flow graph. Note that it does not take
                                        angr.analyses.CFGEmulated or angr.analyses.CFGFast.
        :param int dst_run:             An address specifying the target SimRun.
        :param int dst_stmt_idx:        The target statement index. -1 means executing until the last statement.
        :param str direction:           'backward' or 'forward' slicing. Forward slicing is not yet supported.
        :param angr.Project project:    The project instance.
        :param angr.analyses.CFGBase cfg: the CFG instance. It will be made mandatory later.
        :param bool ignore_sp:          Whether the stack pointer should be ignored in dependency tracking. Any
                                        dependency from/to stack pointers will be ignored if this options is True.
        :param bool ignore_bp:          Whether the base pointer should be ignored or not.
        :param int  max_level:          The maximum number of blocks that we trace back for.
        :param int stop_at_calls:       Limit slicing within a single function. Do not proceed when encounters a call
                                        edge.
        :return: None
        """

        self._graph = graph
        self._dst_run = dst_run
        self._dst_stmt_idx = dst_stmt_idx
        self._ignore_sp = ignore_sp
        self._ignore_bp = ignore_bp
        self._max_level = max_level
        self._base_state = base_state
        self._stop_at_calls = stop_at_calls
        self._cross_insn_opt = cross_insn_opt

        self._slice = networkx.DiGraph()

        self.project = project
        self._cfg = cfg.model
        if self._cfg is None:
            # `cfg` is made optional only for compatibility concern. It will be made a positional parameter later.
            raise AngrBladeError('"cfg" must be specified.')

        if not self._in_graph(self._dst_run):
            raise AngrBladeError("The specified SimRun %s doesn't exist in graph." % self._dst_run)

        self._ignored_regs = set()
        if ignored_regs:
            for r in ignored_regs:
                if isinstance(r, int):
                    self._ignored_regs.add(r)
                else:
                    self._ignored_regs.add(self.project.arch.registers[r][0])

        self._run_cache = { }

        self._traced_runs = set()

        if direction == 'backward':
            self._backward_slice()
        elif direction == 'forward':
            raise AngrBladeError('Forward slicing is not implemented yet')
        else:
            raise AngrBladeError("Unknown slicing direction %s" % direction)
def __init__ ( self , graph , dst_run , dst_stmt_idx , direction = 'backward' , project = None , cfg = None , ignore_sp = False , ignore_bp = False , ignored_regs = None , max_level = 3 , base_state = None , stop_at_calls = False , cross_insn_opt = False ) : self . _graph = graph self . _dst_run = dst_run self . _dst_stmt_idx = dst_stmt_idx self . _ignore_sp = ignore_sp self . _ignore_bp = ignore_bp self . _max_level = max_level self . _base_state = base_state self . _stop_at_calls = stop_at_calls self . _cross_insn_opt = cross_insn_opt self . _slice = networkx . DiGraph ( ) self . project = project self . _cfg = cfg . model if self . _cfg is None : # `cfg` is made optional only for compatibility concern. It will be made a positional parameter later. raise AngrBladeError ( '"cfg" must be specified.' ) if not self . _in_graph ( self . _dst_run ) : raise AngrBladeError ( "The specified SimRun %s doesn't exist in graph." % self . _dst_run ) self . _ignored_regs = set ( ) if ignored_regs : for r in ignored_regs : if isinstance ( r , int ) : self . _ignored_regs . add ( r ) else : self . _ignored_regs . add ( self . project . arch . registers [ r ] [ 0 ] ) self . _run_cache = { } self . _traced_runs = set ( ) if direction == 'backward' : self . _backward_slice ( ) elif direction == 'forward' : raise AngrBladeError ( 'Forward slicing is not implemented yet' ) else : raise AngrBladeError ( "Unknown slicing direction %s" % direction )