예제 #1
0
 def handler_find_symbol(self):
     accept, input = InputDialog().input(self.app_window,
                                         'find symbol by pattern',
                                         placeholder='*_open*')
     if accept:
         SearchPanel.debug_symbol_search_panel(
             self.app_window.get_app_instance(), input)
예제 #2
0
 def handler_kernel_lookup_symbol(self):
     accept, input = InputDialog().input(
         self.app_window,
         'lookup kernel symbol by exact name',
         placeholder='SyS_open')
     if accept and len(input) > 0:
         self.app_window.get_dwarf().get_kernel().lookup_symbol(input)
예제 #3
0
 def handler_find_bytes(self):
     accept, input = InputDialog().input(self.app_window,
                                         'find bytes',
                                         placeholder='ff b3 ac 9d 0f ...')
     if accept:
         self.action_find_bytes.setEnabled(False)
         SearchPanel.bytes_search_panel(self.app_window.get_app_instance(),
                                        input)
예제 #4
0
    def set_condition(self):
        if len(self.selectedItems()) < 1:
            return
        item = self.item(self.selectedItems()[0].row(), 0)

        inp = InputDialog().input('insert condition', input_content=item.get_hook_data().get_condition())
        if inp[0]:
            if self.app.get_script().exports.hookcond(item.get_hook_data().get_ptr(), inp[1]):
                item.get_hook_data().set_condition(inp[1])
예제 #5
0
 def set_condition(self, item):
     item = self.item(item.row(), 0)
     accept, input = InputDialog().input(
         self.app, 'insert condition', input_content=item.get_hook_data().get_condition())
     if accept:
         what = item.get_hook_data().get_ptr()
         if what == 0:
             what = item.get_hook_data().get_input()
         if self.app.dwarf_api('setHookCondition', [what, input]):
             item.get_hook_data().set_condition(input)
예제 #6
0
 def set_condition(self, item):
     inp = InputDialog().input(
         'insert condition',
         input_content=item.get_hook_data().get_condition())
     if inp[0]:
         what = item.get_hook_data().get_ptr()
         if what == 0:
             what = item.get_hook_data().get_input()
         if self.app.dwarf_api('setHookCondition', [what, inp[1]]):
             item.get_hook_data().set_condition(inp[1])
예제 #7
0
파일: menu_bar.py 프로젝트: zbx91/Dwarf
    def handler_find_bytes(self):
        # invalidate modules list filter
        self._bytes_find_modules_list = None

        accept, input = InputDialog().input(self.app_window, 'find bytes',
                                            placeholder='ff b3 ac 9d 0f ...',
                                            options_callback=self.handler_find_bytes_options)
        if accept:
            self.action_find_bytes.setEnabled(False)
            SearchPanel.bytes_search_panel(self.app_window.get_app_instance(), input,
                                           self._bytes_find_modules_list)

        # invalidate it once again
        self._bytes_find_modules_list = None
예제 #8
0
 def handler_find_symbol(self):
     accept, input = InputDialog().input('find symbol by pattern',
                                         placeholder='*_open*')
     if accept:
         matches = self.app_window.get_app_instance().dwarf_api(
             'findSymbol', input)
         if len(matches) > 0:
             data = []
             for ptr in matches:
                 sym = self.app_window.get_app_instance().dwarf_api(
                     'getSymbolByAddress', ptr)
                 if sym['name'] == '' or sym['name'] is None:
                     sym['name'] = sym['address']
                 data.append(sym)
             TableDialog().build_and_show(self.build_symbol_table, data)
예제 #9
0
 def trigger_insert_var(self):
     i = InputDialog().input('create global variable')
     if i[0]:
         content = i[1]
         if content.startswith('var '):
             content = content[4:]
         parts = content.split('=')
         if len(parts) == 2:
             res = self.app.get_script().exports.addvar(content)
             k = parts[0].replace(' ', '')
             if res[0]:
                 if k in self.vars:
                     self.removeRow(self.vars[k][1])
                 row = self.append_var(k, res[0], res[1])
                 self.vars[k] = [res[0], row]
             elif k in self.vars:
                 self.remove_var(self.vars[k][1])
예제 #10
0
 def _on_modify_condition(self, num_row):
     item = self._hooks_model.item(num_row, 4)
     data = item.data(Qt.UserRole + 2)
     if data is None:
         data = ''
     ptr = self._hooks_model.item(num_row, 0).text()
     accept, input_ = InputDialog().input(
         self._app_window, 'Insert condition for %s' % ptr, input_content=data)
     if accept:
         what = utils.parse_ptr(ptr)
         if what == 0:
             what = self._hooks_model.item(num_row, 2).data(Qt.UserRole + 2)
         if self._app_window.dwarf.dwarf_api('setHookCondition', [what, input_]):
             item.setData(input_, Qt.UserRole + 2)
             if not item.text():
                 item.setText('ƒ')
             item.setToolTip(input_)
             self.onHookChanged.emit(ptr)