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


Python Process.suspend方法代码示例

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


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

示例1: print_alnum_jump_addresses

# 需要导入模块: from winappdbg import Process [as 别名]
# 或者: from winappdbg.Process import suspend [as 别名]
def print_alnum_jump_addresses(pid):

    # Request debug privileges so we can inspect the memory of services too.
    System.request_debug_privileges()

    # Suspend the process so there are no malloc's and free's while iterating.
    process = Process(pid)
    process.suspend()
    try:

        # For each executable alphanumeric address...
        for address, packed, module in iterate_alnum_jump_addresses(process):

            # Format the address for printing.
            numeric = HexDump.address(address, process.get_bits())
            ascii   = repr(packed)

            # Format the module name for printing.
            if module:
                modname = module.get_name()
            else:
                modname = ""

            # Try to disassemble the code at this location.
            try:
                code = process.disassemble(address, 16)[0][2]
            except NotImplementedError:
                code = ""

            # Print it.
            print numeric, ascii, modname, code

    # Resume the process when we're done.
    # This is inside a "finally" block, so if the program is interrupted
    # for any reason we don't leave the process suspended.
    finally:
        process.resume()
开发者ID:Kent1,项目名称:winappdbg,代码行数:39,代码来源:03_find_alnum.py


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