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


Python idautils.Names方法代码示例

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


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

示例1: recover_region_variables

# 需要导入模块: import idautils [as 别名]
# 或者: from idautils import Names [as 别名]
def recover_region_variables(M, S, seg_ea, seg_end_ea, exported_vars):
  """Look for named locations pointing into the data of this segment, and
  add them to the protobuf."""
  is_code_seg = is_code(seg_ea)

  for ea, name in idautils.Names():
    if ea < seg_ea or ea >= seg_end_ea:
      continue

    if is_external_segment_by_flags(ea) or ea in EXTERNAL_VARS_TO_RECOVER:
      continue

    if is_code_seg and is_code_by_flags(ea):
      continue

    # Only add named internal variables if they are referenced or exported. 
    if is_referenced(ea) or ea in exported_vars:
      DEBUG("Variable {} at {:x}".format(name, ea))
      V = S.vars.add()
      V.ea = ea
      V.name = name.format('utf-8') 
开发者ID:lifting-bits,项目名称:mcsema,代码行数:23,代码来源:get_cfg.py

示例2: do_export

# 需要导入模块: import idautils [as 别名]
# 或者: from idautils import Names [as 别名]
def do_export():
    db = {}
    module = idaapi.get_root_filename().lower()
    base = idaapi.get_imagebase()

    file = ida_kernwin.ask_file(1, "x64dbg database|{}".format(get_file_mask()),
                                "Export database")
    if not file:
        return
    print("Exporting database {}".format(file))

    db["labels"] = [{
        "text": name,
        "manual": False,
        "module": module,
        "address": "{:#x}".format(ea - base)
    } for (ea, name) in idautils.Names()]
    print("{:d} label(s) exported".format(len(db["labels"])))

    db["comments"] = [{
        "text": comment.replace("{", "{{").replace("}", "}}"),
        "manual": False,
        "module": module,
        "address": "{:#x}".format((ea - base))
    } for (ea, comment) in Comments()]
    print("{:d} comment(s) exported".format(len(db["comments"])))

    db["breakpoints"] = [{
        "address": "{:#x}".format(ea - base),
        "enabled": True,
        "type": bptype,
        "titantype": "{:#x}".format(titantype),
        "oldbytes": "{:#x}".format(oldbytes),
        "module": module,
    } for (ea, bptype, titantype, oldbytes) in Breakpoints()]
    print("{:d} breakpoint(s) exported".format(len(db["breakpoints"])))

    with open(file, "w") as outfile:
        json.dump(db, outfile, indent=1)
    print("Done!") 
开发者ID:x64dbg,项目名称:x64dbgida,代码行数:42,代码来源:x64dbgida.py

示例3: get_names

# 需要导入模块: import idautils [as 别名]
# 或者: from idautils import Names [as 别名]
def get_names():
    """
    Get symbols from IDA database

    :return: Dict containing symbol information
    """

    symbols = {}
    for addr, name in idautils.Names():
        symbols[addr] = name

    return symbols 
开发者ID:zznop,项目名称:bnida,代码行数:14,代码来源:ida_export.py

示例4: get_segment_names

# 需要导入模块: import idautils [as 别名]
# 或者: from idautils import Names [as 别名]
def get_segment_names(seg):
    names = []
    def fun(seg):
        names.extend([(a, n) for (a, n) in idautils.Names()
                      if seg.startEA <= a < seg.endEA])
    idaapi.execute_sync(partial(fun, seg), idaapi.MFF_READ)
    return names 
开发者ID:Riscure,项目名称:DROP-IDA-plugin,代码行数:9,代码来源:helpers.py

示例5: name_exists

# 需要导入模块: import idautils [as 别名]
# 或者: from idautils import Names [as 别名]
def name_exists(name):
    """ Return 'True' if name exists in current IDB file. """
    for _, existing_names in idautils.Names():  # generates (addr, name) tuples
        if name in existing_names:
            return True
    return False 
开发者ID:fireeye,项目名称:flare-ida,代码行数:8,代码来源:__init__.py


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