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


Python idaapi.MFF_WRITE属性代码示例

本文整理汇总了Python中idaapi.MFF_WRITE属性的典型用法代码示例。如果您正苦于以下问题:Python idaapi.MFF_WRITE属性的具体用法?Python idaapi.MFF_WRITE怎么用?Python idaapi.MFF_WRITE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在idaapi的用法示例。


在下文中一共展示了idaapi.MFF_WRITE属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: safe_generator

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import MFF_WRITE [as 别名]
def safe_generator(iterator):

    # Make the sentinel value something that isn't likely to be returned
    # by an API call (and isn't a fixed string that could be inserted into
    # a program to break FIRST maliciously)
    sentinel = '[1st] Sentinel %d' % (random.randint(0, 65535))

    holder = [sentinel] # need a holder, because 'global' sucks

    def trampoline():
        try:
            holder[0] = next(iterator)
        except StopIteration:
            holder[0] = sentinel
        return 1

    while True:
        # See notes above regarding why we use MFF_WRITE here
        idaapi.execute_sync(trampoline, idaapi.MFF_WRITE)
        if holder[0] == sentinel:
            return
        yield holder[0]

#   Main Plug-in Form Class
#------------------------------------------------------------------------------- 
开发者ID:vrtadmin,项目名称:FIRST-plugin-ida,代码行数:27,代码来源:first.py

示例2: __getattribute__

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import MFF_WRITE [as 别名]
def __getattribute__(self, name):
        default = '[1st] default'

        if (idaapi.IDA_SDK_VERSION >= 700) and (name in IDAWrapper.mapping):
            name = IDAWrapper.mapping[name]

        val = getattr(idaapi, name, default)
        if val == default:
            val = getattr(idautils, name, default)

        if val == default:
            val = getattr(idc, name, default)

        if val == default:
            msg = 'Unable to find {}'.format(name)
            idaapi.execute_ui_requests((FIRSTUI.Requests.Print(msg),))
            return

        if hasattr(val, '__call__'):
            def call(*args, **kwargs):
                holder = [None] # need a holder, because 'global' sucks

                def trampoline():
                    holder[0] = val(*args, **kwargs)
                    return 1

                # Execute the request using MFF_WRITE, which should be safe for
                # any possible request at the expense of speed.  In my testing,
                # though, it wasn't noticably slower than MFF_FAST.  If this
                # is observed to impact performance, consider creating a list
                # that maps API calls to the most appropriate flag.
                idaapi.execute_sync(trampoline, idaapi.MFF_WRITE)
                return holder[0]
            return call

        else:
            return val 
开发者ID:vrtadmin,项目名称:FIRST-plugin-ida,代码行数:39,代码来源:first.py

示例3: idawrite

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import MFF_WRITE [as 别名]
def idawrite(f):
    @functools.wraps(f)
    def wrapper(*args, **kwargs):
        ff = functools.partial(f, *args, **kwargs)
        return idaapi.execute_sync(ff, idaapi.MFF_WRITE)
    return wrapper 
开发者ID:andreafioraldi,项目名称:IDAngr,代码行数:8,代码来源:ida_debugger.py

示例4: idawrite

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import MFF_WRITE [as 别名]
def idawrite(f):
    """
    decorator for marking a function as modifying the IDB.
    schedules a request to be made in the main IDA loop to avoid IDB corruption.
    """
    @functools.wraps(f)
    def wrapper(*args,**kwargs):
        ff = functools.partial(f,*args,**kwargs)
        ff.__name__ = f.__name__
        return sync_wrapper(ff,idaapi.MFF_WRITE)
    return wrapper 
开发者ID:xorpd,项目名称:fcatalog_client,代码行数:13,代码来源:idasync.py

示例5: execute_write

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import MFF_WRITE [as 别名]
def execute_write(function):
        return execute_sync(function, idaapi.MFF_WRITE) 
开发者ID:gaasedelen,项目名称:lighthouse,代码行数:4,代码来源:ida_api.py

示例6: reset_block_colors

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import MFF_WRITE [as 别名]
def reset_block_colors(f):
    def fun():
        cbs = sark.codeblocks(start=f.startEA, end=f.endEA)
        for cb in cbs:
            cb.color = 0xFFFFFF
    idaapi.execute_sync(fun, idaapi.MFF_WRITE) 
开发者ID:Riscure,项目名称:DROP-IDA-plugin,代码行数:8,代码来源:helpers.py

示例7: set_block_color

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import MFF_WRITE [as 别名]
def set_block_color(addr, color):
    def fun(addr, color):
        cb = sark.CodeBlock(addr)
        if cb:
            cb.color = color
    idaapi.execute_sync(partial(fun, addr, color), idaapi.MFF_WRITE) 
开发者ID:Riscure,项目名称:DROP-IDA-plugin,代码行数:8,代码来源:helpers.py

示例8: execute_paint

# 需要导入模块: import idaapi [as 别名]
# 或者: from idaapi import MFF_WRITE [as 别名]
def execute_paint(function):
    """
    A function decorator to safely paint the IDA database from any thread.
    """

    @functools.wraps(function)
    def wrapper(*args, **kwargs):

        #
        # the first argument passed to this decorator will be the
        # IDAPainter class instance
        #

        ida_painter = args[0]

        #
        # we wrap up the remaining args (and paint function) into a single
        # packaged up callable object (a functools.partial)
        #

        ff = functools.partial(function, *args, **kwargs)

        #
        # if we are using a 'bugged' downlevel version of IDA, package another
        # callable to 'synchronize' a database write. This callable will get
        # passed to the main thread and executed through the Qt event loop.
        #
        # the execute_sync should technically happy in-line, avoiding the
        # possibility of deadlocks or aborts as described above.
        #

        if idaapi.IDA_SDK_VERSION < 710:
            fff = functools.partial(idaapi.execute_sync, ff, idaapi.MFF_WRITE)
            ida_painter._signal.mainthread.emit(fff)
            return idaapi.BADADDR

        #
        # in IDA 7.1, the MFF_NOWAIT bug is definitely fixed, so we can just
        # use it to schedule our paint action ... as designed.
        #

        return idaapi.execute_sync(ff, idaapi.MFF_NOWAIT | idaapi.MFF_WRITE)
    return wrapper

#------------------------------------------------------------------------------
# IDA Painter
#------------------------------------------------------------------------------ 
开发者ID:gaasedelen,项目名称:lighthouse,代码行数:49,代码来源:ida_painter.py


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