コード例 #1
0
ファイル: GeneratorTableModel.py プロジェクト: yarda/urh
    def add_empty_row_behind(self, row_index: int, num_bits: int):
        message = Message(plain_bits=[0]*num_bits,
                          pause=constants.SETTINGS.value("default_fuzzing_pause", 10**6, int),
                          message_type=self.protocol.default_message_type)

        tmp_protocol = ProtocolAnalyzer(None)
        tmp_protocol.messages = [message]
        undo_action = InsertBitsAndPauses(self.protocol, row_index+1, tmp_protocol)
        self.undo_stack.push(undo_action)
コード例 #2
0
    def add_empty_row_behind(self, row_index: int, num_bits: int):
        message = Message(plain_bits=[0]*num_bits,
                          pause=constants.SETTINGS.value("default_fuzzing_pause", 10**6, int),
                          message_type=self.protocol.default_message_type)

        tmp_protocol = ProtocolAnalyzer(None)
        tmp_protocol.messages = [message]
        undo_action = InsertBitsAndPauses(self.protocol, row_index+1, tmp_protocol)
        self.undo_stack.push(undo_action)
コード例 #3
0
    def generate_de_bruijn(self, row_index: int, start: int, end: int):
        if start < 0 or end < 0:
            return

        f = 1 if self.proto_view == 0 else 4 if self.proto_view == 1 else 8
        start, end = f * start, f * end

        de_bruijn_seq = util.de_bruijn(end-start)

        tmp_protocol = ProtocolAnalyzer(None)
        tmp_protocol.messages = []
        LINE_BREAK_AFTER = 5000 * f
        for i in range(0, len(de_bruijn_seq), LINE_BREAK_AFTER):
            message = Message(plain_bits=de_bruijn_seq[i:i+LINE_BREAK_AFTER],
                              pause=0,
                              message_type=self.protocol.default_message_type)
            tmp_protocol.messages.append(message)

        undo_action = InsertBitsAndPauses(self.protocol, row_index+1, tmp_protocol)
        self.undo_stack.push(undo_action)