Beispiel #1
0
 def _request_response_listener(self, input_data, request_connection, response_connection):
     serialized_request = pickle.dumps(input_data)
     request_id = generate_task_id(input_data)
     self.connections[request_connection]['fs'].put(serialized_request, filename=request_id)
     logging.debug(f'Request sent: {request_connection} -> {request_id}')
     sleep(1)
     return self._response_listener(response_connection, request_id)
 def add_binary_search_request(self,
                               yara_rule_binary: bytes,
                               firmware_uid: Optional[str] = None):
     serialized_request = pickle.dumps((yara_rule_binary, firmware_uid))
     request_id = generate_task_id(yara_rule_binary)
     self.connections["binary_search_task"]['fs'].put(serialized_request,
                                                      filename=request_id)
     return request_id
 def _request_response_listener(self, input_data, request_connection,
                                response_connection):
     serialized_request = pickle.dumps(input_data)
     request_id = generate_task_id(input_data)
     self.connections[request_connection]['fs'].put(
         serialized_request, filename="{}".format(request_id))
     logging.debug('Request sent: {} -> {}'.format(request_connection,
                                                   request_id))
     sleep(2)
     return self._response_listener(response_connection, request_id)
 def add_binary_search_request(self, yara_rule_binary):
     serialized_request = pickle.dumps(yara_rule_binary)
     request_id = generate_task_id(yara_rule_binary)
     self.connections["binary_search_task"]['fs'].put(
         serialized_request, filename="{}".format(request_id))
     return request_id