本文整理汇总了Python中jarvis.core.helpers.Misc.paint_basic_blocks方法的典型用法代码示例。如果您正苦于以下问题:Python Misc.paint_basic_blocks方法的具体用法?Python Misc.paint_basic_blocks怎么用?Python Misc.paint_basic_blocks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jarvis.core.helpers.Misc
的用法示例。
在下文中一共展示了Misc.paint_basic_blocks方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _bbTableDoubleClicked
# 需要导入模块: from jarvis.core.helpers import Misc [as 别名]
# 或者: from jarvis.core.helpers.Misc import paint_basic_blocks [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: import_data
# 需要导入模块: from jarvis.core.helpers import Misc [as 别名]
# 或者: from jarvis.core.helpers.Misc import paint_basic_blocks [as 别名]
def import_data(self, bb_color = 0x581414):
"""
Pretty straightforward, isn't it? ;)
@return: dictionary d[tid] = [bb_ea, ...]
"""
filename = AskFile(1, "*.*", "File to import addresses from?")
# Rebase
image_base = self.get_image_base(filename)
ida_base = get_imagebase() # idaapi
delta = image_base - ida_base
if delta:
# IDA would go ahead with the rebasing process
# even if the delta is zero. This avoids it.
rebase_program(delta, MSF_FIXONCE)
# Parse basic blocks from file
trace_dict = self.file_parser(filename)
for addr_list in trace_dict.values():
for _, v_ea in addr_list:
misc.paint_basic_blocks(v_ea, bb_color)
return trace_dict