当前位置: 首页>>代码示例>>Python>>正文


Python Misc.paint_basic_blocks方法代码示例

本文整理汇总了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
开发者ID:h0wl,项目名称:JARVIS,代码行数:35,代码来源:BinaryAnalysisWidget.py

示例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
开发者ID:0xr0ot,项目名称:JARVIS,代码行数:27,代码来源:ImportExport.py


注:本文中的jarvis.core.helpers.Misc.paint_basic_blocks方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。