Example #1
0
    def _execute(self, preset_name: str):
        _show_symbols_and_functions_tabs(self.suite.top_window())

        presets_panel = DataViewPanel(
            self.find_control('Group', 'PresetsDataView'))
        preset_row = presets_panel.find_first_item_row(preset_name, 1, True)
        self.expect_true(preset_row is not None, 'Found preset.')
        status_text = presets_panel.get_item_at(preset_row, 0).texts()[0]

        if 'No' in status_text:
            app_menu = self.suite.top_window().descendants(
                control_type="MenuBar")[1]
            app_menu.item_by_path("File->Open Preset...").click_input()
            dialog = self.suite.top_window().child_window(
                title_re="Select a file*")
            dialog.FileNameEdit.type_keys(preset_name)
            dialog.FileNameEdit.type_keys('{DOWN}{ENTER}')

            message_box = self.suite.top_window().child_window(
                title_re="Preset loading failed*")
            self.expect_true(message_box is not None, 'Message box found.')
            message_box.Ok.click()
        else:
            presets_panel.get_item_at(preset_row,
                                      0).click_input(button='right')
            self.find_context_menu_item('Load Preset').click_input()
            logging.info('Loaded preset: %s', preset_name)

            if 'Partially' in status_text:
                message_box = self.suite.top_window().child_window(
                    title_re="Preset only partially loaded*")
                self.expect_true(message_box is not None, 'Message box found.')
                message_box.Ok.click()
Example #2
0
    def _load_presets(self):
        presets_panel = DataViewPanel(self.find_control('Group', 'PresetsDataView'))

        draw_frame_preset_row = presets_panel.find_first_item_row('draw_frame_in_hello_ggp_1_52', 1, True)
        issue_frame_token_preset_row = presets_panel.find_first_item_row(
            'ggp_issue_frame_token_in_hello_ggp_1_52', 1, True)

        self.expect_true(draw_frame_preset_row is not None, 'Found draw_frame preset')
        self.expect_true(issue_frame_token_preset_row is not None, 'Found ggp_issue_frame_token preset')

        presets_panel.get_item_at(draw_frame_preset_row, 0).click_input(button='right')
        self.find_context_menu_item('Load Preset').click_input()
        logging.info('Loaded Preset DrawFrame')

        presets_panel.get_item_at(issue_frame_token_preset_row, 0).click_input(button='right')
        self.find_context_menu_item('Load Preset').click_input()
        logging.info('Loaded Preset GgpIssueFrameToken')
Example #3
0
    def _try_verify_functions_are_hooked(self):
        logging.info('Finding rows in the function list')
        functions_panel = DataViewPanel(self.find_control('Group', 'FunctionsDataViewD'))
        draw_frame_row = functions_panel.find_first_item_row('DrawFrame', 1)
        issue_frame_token_row = functions_panel.find_first_item_row('GgpIssueFrameToken', 1)

        if draw_frame_row is None:
            return False
        if issue_frame_token_row is None:
            return False

        logging.info('Verifying hook status of functions')
        self.expect_true('✓' in functions_panel.get_item_at(draw_frame_row, 0).texts()[0],
                         'DrawFrame is marked as hooked')
        self.expect_true('✓' in functions_panel.get_item_at(issue_frame_token_row, 0).texts()[0],
                         'GgpIssueFrameToken is marked as hooked')

        return True
Example #4
0
    def _execute(self, preset_name: str, expected_status: PresetStatus):
        _show_symbols_and_functions_tabs(self.suite.top_window())

        presets_panel = DataViewPanel(self.find_control('Group', 'PresetsDataView'))
        preset_row = presets_panel.find_first_item_row(preset_name, 1, True)
        self.expect_true(preset_row is not None, 'Found preset.')
        status_text = presets_panel.get_item_at(preset_row, 0).texts()[0]
        if expected_status is PresetStatus.LOADABLE:
            self.expect_true('Yes' in status_text, 'Preset is loadable.')
        if expected_status is PresetStatus.PARTIALLY_LOADABLE:
            self.expect_true('Partially' in status_text, 'Preset is partially loadable.')
        if expected_status is PresetStatus.NOT_LOADABLE:
            self.expect_true('No' in status_text, 'Preset is not loadable.')
Example #5
0
    def _execute(self, function_search_string: str, expect_hooked: bool = True):
        _show_symbols_and_functions_tabs(self.suite.top_window())

        functions_dataview = DataViewPanel(self.find_control("Group", "FunctionsDataView"))
        functions_dataview.filter.set_focus()
        functions_dataview.filter.set_edit_text('')
        send_keys(function_search_string)
        row = functions_dataview.find_first_item_row(function_search_string, 1)
        if expect_hooked:
            self.expect_true('✓' in functions_dataview.get_item_at(row, 0).texts()[0],
                             'Function is marked as hooked.')
        else:
            self.expect_true('✓' not in functions_dataview.get_item_at(row, 0).texts()[0],
                             'Function is not marked as hooked.')