def __init__(self, protocol: ProtocolAnalyzerContainer, label_index: int, msg_index: int, proto_view: int, parent=None): super().__init__(parent) self.ui = Ui_FuzzingDialog() self.ui.setupUi(self) self.setAttribute(Qt.WA_DeleteOnClose) self.protocol = protocol msg_index = msg_index if msg_index != -1 else 0 self.ui.spinBoxFuzzMessage.setValue(msg_index + 1) self.ui.spinBoxFuzzMessage.setMinimum(1) self.ui.spinBoxFuzzMessage.setMaximum(self.protocol.num_messages) self.ui.comboBoxFuzzingLabel.addItems([l.name for l in self.message.message_type]) self.ui.comboBoxFuzzingLabel.setCurrentIndex(label_index) self.proto_view = proto_view self.fuzz_table_model = FuzzingTableModel(self.current_label, proto_view) self.fuzz_table_model.remove_duplicates = self.ui.chkBRemoveDuplicates.isChecked() self.ui.tblFuzzingValues.setModel(self.fuzz_table_model) self.fuzz_table_model.update() self.ui.spinBoxFuzzingStart.setValue(self.current_label_start + 1) self.ui.spinBoxFuzzingEnd.setValue(self.current_label_end) self.ui.spinBoxFuzzingStart.setMaximum(len(self.message_data)) self.ui.spinBoxFuzzingEnd.setMaximum(len(self.message_data)) self.update_message_data_string() self.ui.tblFuzzingValues.resize_me() self.create_connects() try: self.restoreGeometry(constants.SETTINGS.value("{}/geometry".format(self.__class__.__name__))) except TypeError: pass
def __init__(self, proto_container: ProtocolAnalyzerContainer, label_index, proto_view: int, parent=None): super().__init__(parent) self.ui = Ui_FuzzingDialog() self.ui.setupUi(self) self.setAttribute(Qt.WA_DeleteOnClose) self.current_label_index = label_index self.proto_container = proto_container self.proto_view = proto_view self.fuzz_table_model = FuzzingTableModel(self.current_label, proto_view) self.fuzz_table_model.remove_duplicates = self.ui.chkBRemoveDuplicates.isChecked( ) self.ui.tblFuzzingValues.setModel(self.fuzz_table_model) self.fuzz_table_model.update() self.ui.comboBoxFuzzingLabel.addItems( [l.name for l in self.proto_container.protocol_labels]) self.ui.comboBoxFuzzingLabel.setCurrentIndex(self.current_label_index) self.ui.spinBoxRefBlock.setMinimum(1) self.ui.spinBoxRefBlock.setMaximum(self.proto_container.num_blocks) self.ui.spinBoxRefBlock.setValue(self.current_label.refblock + 1) self.ui.spinBoxFuzzingStart.setValue(self.current_label_start + 1) self.ui.spinBoxFuzzingEnd.setValue(self.current_label_end) self.ui.spinBoxFuzzingStart.setMaximum(len(self.block_data)) self.ui.spinBoxFuzzingEnd.setMaximum(len(self.block_data)) self.epic_mode = False self.update_block_data_string() self.ui.tblFuzzingValues.resize_me() self.create_connects()