How to use the continuum.project.Project function in continuum

To help you get started, we’ve selected a few continuum examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zyantific / continuum / continuum / analyze.py View on Github external
import os
from idc import *
from idautils import *

sys.path.append(
    os.path.join(
        os.path.dirname(os.path.realpath(__file__)),
        '..',
    )
)

from continuum import Continuum
from continuum.project import Project

# Connect to server instance.
proj = Project()
cont = Continuum()
proj.open(Project.find_project_dir(GetIdbDir()), skip_analysis=True)
cont.open_project(proj)

# Wait for auto-analysis to complete.
SetShortPrm(INF_AF2, GetShortPrm(INF_AF2) | AF2_DODATA)
print("Analyzing input file ...")
cont.client.send_analysis_state('auto-analysis')
Wait()

# Index types.
print("Indexing types ...")
cont.client.send_analysis_state('indexing-types')
proj.index.index_types_for_this_idb()

# Index symbols.
github zyantific / continuum / continuum / plugin.py View on Github external
return

        # Check if auto-analysis is through prior allowing project creation here.
        # This probably isn't intended to be done by plugins, but there there seems to be no
        # official API to check for this that also works when auto-analysis has temporarily
        # been disabled due to an UI action (specifically here: opening menus).
        # I found this netnode by reversing IDA.
        if not idaapi.exist(idaapi.netnode("$ Auto ready")):
            print("[continuum] Please allow auto-analysis to finish first.")
            return

        dialog = ProjectCreationDialog(GetIdbDir())
        chosen_action = dialog.exec_()

        if chosen_action == QDialog.Accepted:
            project = Project.create(dialog.project_path, dialog.file_patterns)
            self.core.open_project(project)
github zyantific / continuum / continuum / project.py View on Github external
"""Creates a new project."""
        # Create meta directory.
        cont_dir = os.path.join(root, cls.META_DIR_NAME)
        if os.path.exists(cont_dir):
            raise Exception("Directory is already a continuum project")
        os.mkdir(cont_dir)

        # Create config file.
        config = ConfigParser.SafeConfigParser()
        config.add_section('project')
        config.set('project', 'file_patterns', file_patterns)
        with open(os.path.join(cont_dir, cls.CFG_FILE_NAME), 'w') as f:
            config.write(f)

        # Create initial index.
        project = Project()
        project.open(root)

        return project
github zyantific / continuum / continuum / project.py View on Github external
def __init__(self):
        super(Project, self).__init__()
        self.conf = None
        self.index = None
        self.proj_dir = None
        self.meta_dir = None
        self.ignore_changes = False
        self.files = []
github zyantific / continuum / continuum / __init__.py View on Github external
from .server import Server
from .client import Client
from .project import Project


def launch_ida_gui_instance(idb_path):
    """Launches a fresh IDA instance, opening the given IDB."""
    return subprocess.Popen([sys.executable, idb_path])


class Continuum(QObject):
    """
    Plugin core class, providing functionality required for both, the
    analysis stub and the full GUI instance version.
    """
    project_opened = pyqtSignal([Project])
    project_closing = pyqtSignal()
    client_created = pyqtSignal([Client])

    def __init__(self):
        super(Continuum, self).__init__()

        self.project = None
        self.client = None
        self.server = None
        self._timer = None

        # Sign up for events.
        idaapi.notify_when(idaapi.NW_OPENIDB, self.handle_open_idb)
        idaapi.notify_when(idaapi.NW_CLOSEIDB, self.handle_close_idb)

    def create_server_if_none(self):
github zyantific / continuum / continuum / __init__.py View on Github external
def handle_open_idb(self, _, is_old_database):
        """Performs start-up tasks when a new IDB is loaded."""
        # Is IDB part of a continuum project? Open it.
        proj_dir = Project.find_project_dir(GetIdbDir())
        if proj_dir:
            project = Project()
            project.open(proj_dir)
            self.open_project(project)
            project.index.sync_types_into_idb()