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")
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)
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
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()
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)