本文整理汇总了Python中jarvis.core.helpers.Misc.pyside_to_ida_color方法的典型用法代码示例。如果您正苦于以下问题:Python Misc.pyside_to_ida_color方法的具体用法?Python Misc.pyside_to_ida_color怎么用?Python Misc.pyside_to_ida_color使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jarvis.core.helpers.Misc
的用法示例。
在下文中一共展示了Misc.pyside_to_ida_color方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _bbTableDoubleClicked
# 需要导入模块: from jarvis.core.helpers import Misc [as 别名]
# 或者: from jarvis.core.helpers.Misc import pyside_to_ida_color [as 别名]
def _bbTableDoubleClicked(self, row, col):
"""
This overrides the callback for table's double click
set in the CustomWidget object.
Apparently if there is an exception it falls back to
the original callback... Not sure why this behaviour.
NOTE: This is kind of nasty.
:return: None
"""
it = self.table.item(row, col).text()
try:
idx = int(it) # decimal
bb_path = self.ba.cache.bb_paths[idx]
col = QtGui.QColorDialog.getColor()
if col.isValid():
# IDA works with BGR (annoying)
ida_color = misc.pyside_to_ida_color(col.name())
misc.paint_basic_blocks(bb_path, ida_color)
else:
print '[x] Invalid QColor'
return
except IndexError:
# Address value (does not contain [A-F]) is interpreted as index
return
except ValueError:
# Address value (containing [A-F]) fucks up int()
return
示例2: _showImportTrace
# 需要导入模块: from jarvis.core.helpers import Misc [as 别名]
# 或者: from jarvis.core.helpers.Misc import pyside_to_ida_color [as 别名]
def _showImportTrace(self):
"""
This is the GUI part of the PIN trace import functionality
"""
self._console_output("Importing PIN trace information from file...")
# Color for the basic blocks hit during the trace
col = QtGui.QColorDialog.getColor()
if col.isValid():
# IDA works with BGR (annoying)
ida_color = misc.pyside_to_ida_color(col.name())
else:
# Probably closed the QColorDialog
self._console_output("[!] Problem getting color for trace. Aborting.")
return
try:
imported_info_dict = self.ie.ti.import_data(ida_color)
except:
self._console_output("[!] Problem importing from file", err = True)
self._console_output(traceback.format_exc(), err = True)
return
self.table.setColumnCount(5)
self.table.setHorizontalHeaderLabels(
('Thread ID', 'From', 'To', 'From (name)', 'To (name)'))
self.table_label.setText("Imported information from PIN trace")
self.table.clearContents()
self.table.setRowCount(0)
# Fill with contents
# TODO: This could be better in a QTree or maybe adding
# a dropdown to select the thread id...
idx = 0
for tid, call_list in imported_info_dict.iteritems():
self._console_output("Processing Thread ID %d" % tid)
for u_ea, v_ea in call_list:
self.table.insertRow(idx)
tid_item = QTableWidgetItem("%d" % tid)
u_item = QTableWidgetItem("%x" % u_ea)
u_item.setFlags(u_item.flags() ^ QtCore.Qt.ItemIsEditable)
v_item = QTableWidgetItem("%x" % v_ea)
v_item.setFlags(v_item.flags() ^ QtCore.Qt.ItemIsEditable)
from_item = QTableWidgetItem(misc.get_function_name(u_ea))
to_item = QTableWidgetItem(misc.get_function_name(v_ea))
self.table.setItem(idx, 0, tid_item)
self.table.setItem(idx, 1, u_item)
self.table.setItem(idx, 2, v_item)
self.table.setItem(idx, 3, from_item)
self.table.setItem(idx, 4, to_item)
idx += 1