Beispiel #1
0
	def init(self):
		constants.create_general_config_file()
		shared.BASE_URL = constants.get_data_from_config_file("server")
		shared.LOG = constants.get_data_from_config_file("log")
		
		auth = AuthForm()
		auth.Compile()
		auth.Execute()
	
		if shared.IS_COMMUNICATION_MANAGER_STARTED:
			communication_manager_window_handler = constants.get_window_handler_by_id(shared.COMMUNICATION_MANAGER_WINDOW_ID)
			constants.send_data_to_window(communication_manager_window_handler, constants.CHANGE_USER, json.dumps({"username":shared.USERNAME, "id": shared.USERID, "token": shared.USER_TOKEN}))
		
		if idc.GetIdbPath(): #You open IDA directly with a file.
			selector = ProjectSelector(request_project_list())
			selector.Compile()
			selector.Execute()
		if shared.IS_COMMUNICATION_MANAGER_STARTED:
			communication_manager_window_handler = constants.get_window_handler_by_id(shared.COMMUNICATION_MANAGER_WINDOW_ID)
			constants.send_data_to_window(communication_manager_window_handler, constants.CHANGE_PROJECT_ID, json.dumps({"project-id": shared.PROJECT_ID}))
		
		self._live_hook = LiveHookIDP()
		self._live_hook.hook()
		self.hook()
		return idaapi.PLUGIN_KEEP
Beispiel #2
0
    def init(self):
        self._window_handler = create_hidden_window()
        self._id = insert_to_registery(self._window_handler)
        log("Created window")
        shared.INTEGRATOR_WINDOW_ID = self._id
        shared.COMMUNICATION_MANAGER_WINDOW_ID = struct.unpack(
            ">I", os.urandom(4))[0]
        shared.start_communication_manager()
        time.sleep(1)
        shared.IS_COMMUNICATION_MANAGER_STARTED = True
        if shared.USERID != -1:  #started.
            communication_manager_window_handler = constants.get_window_handler_by_id(
                shared.COMMUNICATION_MANAGER_WINDOW_ID)
            constants.send_data_to_window(
                communication_manager_window_handler,
                constants.CHANGE_PROJECT_ID,
                json.dumps({"project-id": shared.PROJECT_ID}))
            constants.send_data_to_window(
                communication_manager_window_handler, constants.CHANGE_USER,
                json.dumps({
                    "username": shared.USERNAME,
                    "id": shared.USERID,
                    "token": shared.USER_TOKEN
                }))

        return idaapi.PLUGIN_KEEP
Beispiel #3
0
def pass_to_manager(ev):
    log("Pass to manager: " + str(ev))
    try:
        communication_manager_window_handler = constants.get_window_handler_by_id(
            shared.COMMUNICATION_MANAGER_WINDOW_ID)
        constants.send_data_to_window(communication_manager_window_handler,
                                      constants.SEND_DATA_TO_SERVER,
                                      ev.encode_to_json())
    except Exception as e:
        pass
Beispiel #4
0
    def init(self):
        if constants.create_general_config_file(
        ):  # if the Config file didnt exist, we want to ask for a server name.
            server = idc.AskStr("", "Server:")
            constants.set_data_to_config_file("server", server)

        shared.BASE_URL = constants.get_data_from_config_file("server")
        shared.LOG = constants.get_data_from_config_file("log")

        self._window_handler = create_hidden_window()
        self._id = insert_to_registery(self._window_handler)
        log("Created window")

        shared.INTEGRATOR_WINDOW_ID = self._id
        shared.COMMUNICATION_MANAGER_WINDOW_ID = struct.unpack(
            ">I", os.urandom(4))[0]
        si = subprocess.STARTUPINFO()
        si.dwFlags |= subprocess.STARTF_USESHOWWINDOW
        subprocess.Popen([
            "python",
            "{0}\communication_manager.py".format(idaapi.idadir("plugins")),
            str(shared.INTEGRATOR_WINDOW_ID),
            str(shared.COMMUNICATION_MANAGER_WINDOW_ID)
        ])
        time.sleep(1)

        shared.IS_COMMUNICATION_MANAGER_STARTED = True
        if shared.USERID != -1:  #started.
            communication_manager_window_handler = constants.get_window_handler_by_id(
                shared.COMMUNICATION_MANAGER_WINDOW_ID)
            constants.send_data_to_window(
                communication_manager_window_handler,
                constants.CHANGE_PROJECT_ID,
                json.dumps({"project-id": shared.PROJECT_ID}))
            constants.send_data_to_window(
                communication_manager_window_handler, constants.CHANGE_USER,
                json.dumps({
                    "username": shared.USERNAME,
                    "id": shared.USERID,
                    "token": shared.USER_TOKEN
                }))

        self.hook()
        for widget in qApp.topLevelWidgets():
            if isinstance(widget, QMainWindow):
                self._window = widget
                break
        return idaapi.PLUGIN_KEEP
Beispiel #5
0
    def term(self):
        try:
            communication_manager_window_handler = constants.get_window_handler_by_id(
                shared.COMMUNICATION_MANAGER_WINDOW_ID)
            constants.send_data_to_window(
                communication_manager_window_handler,
                constants.KILL_COMMUNICATION_MANAGER_MESSAGE_ID, None)
            time.sleep(1)
        except Exception as e:
            pass

        if self.idb_hook:
            self.idb_hook.unhook()
        if self.ui_hook:
            self.ui_hook.unhook()
        if self.idb_hook:
            self.idp_hook.unhook()