Esempio n. 1
0
 def _send_packet(self, event):
     """Sends a packet to the server."""
     # Check if it comes from the auto-analyzer
     if ida_auto.get_auto_state() == ida_auto.AU_NONE:
         self._plugin.network.send_packet(event)
     else:
         self._plugin.logger.debug("Ignoring a packet")
Esempio n. 2
0
 def ev_auto_queue_empty(self, arg):
     #core._plugin.logger.debug("Auto queue empty hook")
     if ida_auto.get_auto_state() == ida_auto.AU_NONE:
         client = core._plugin.network.client
         if client:
             client.call_events()
     return super(self.__class__, self).ev_auto_queue_empty(arg)
Esempio n. 3
0
    def recv_packet(self, packet):
        if isinstance(packet, Command):
            # Call the corresponding handler
            self._handlers[packet.__class__](packet)

        elif isinstance(packet, Event):
            # If we already have some events queued
            if self._events or ida_auto.get_auto_state() != ida_auto.AU_NONE:
                self._events.append(packet)
            else:
                self._call_event(packet)

        else:
            return False
        return True
Esempio n. 4
0
 def auto_queue_empty(self, _):
     core._plugin.logger.debug("Auto queue empty hook")
     if ida_auto.get_auto_state() == ida_auto.AU_NONE:
         client = core._plugin.network.client
         if client:
             client.call_events()
Esempio n. 5
0
 def call_events(self):
     while self._events and ida_auto.get_auto_state() == ida_auto.AU_NONE:
         packet = self._events.pop(0)
         self._call_event(packet)