本文整理汇总了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')
示例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!")
示例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
示例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
示例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