Ejemplo n.º 1
0
    def create_simulation_manager(self, state, state_name, view=None):

        inst = self.instance
        hierarchy = StateHierarchy()
        simgr = inst.project.factory.simulation_manager(state, hierarchy=hierarchy)
        simgr_container = ObjectContainer(simgr, name=state_name)
        inst.simgrs.append(simgr_container)
        inst.simgrs.am_event(src='new_path')

        if view is None:
            view = self._get_or_create_symexec_view()
        view.select_simgr(simgr_container)

        self.raise_view(view)
Ejemplo n.º 2
0
    def create_simulation_manager(self, state, state_name):

        inst = self.instance
        hierarchy = StateHierarchy()
        simgr = inst.project.factory.simulation_manager(state,
                                                        hierarchy=hierarchy)
        simgr_container = ObjectContainer(simgr, name=state_name)
        inst.simgrs.append(simgr_container)
        inst.simgrs.am_event(src='new_path')

        symexec_view = self.views_by_category['symexec'][0]
        symexec_view.select_simgr(simgr_container)

        self.raise_view(symexec_view)
Ejemplo n.º 3
0
    def _new_path(self, path_name, addr):
        inst = self._workspace.instance

        state_record = self._init_state_combo.state_record
        if state_record is None:
            return False

        state = state_record.state(inst.project, address=addr)
        hierarchy = StateHierarchy()
        simgr = inst.project.factory.simgr(state, hierarchy=hierarchy)
        desc = SimulationManagerDescriptor(path_name, simgr)
        inst.simgrs.add_simgr(pg_desc=desc)

        symexec_view = self._workspace.views_by_category['symexec'][0]
        symexec_view.select_simgr_desc(desc)

        self._workspace.raise_view(symexec_view)

        return True
Ejemplo n.º 4
0
    def add_simgr(self, pg_desc=None):
        """
        Add a new simulation manager descriptor.

        :param SimulationManagerDescriptor pg_desc:
        :return: The added/created simulation manager descriptor.
        """

        if pg_desc is None:
            hierarchy = StateHierarchy()
            pg = self.project.factory.simgr(immutable=False,
                                            hierarchy=hierarchy,
                                            save_unconstrained=True,
                                            save_unsat=True)
            pg_desc = SimulationManagerDescriptor(NameGenerator.random_name(),
                                                  pg)

        self.groups.append(pg_desc)

        self._widget.add_simgr(pg_desc)

        return pg_desc