python类get_root_filename()的实例源码

lighthouse_plugin.py 文件源码 项目:lighthouse 作者: gaasedelen 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def _normalize_coverage(self, coverage_data, metadata):
        """
        Normalize loaded DrCov data to the database metadata.
        """

        # extract the coverage relevant to this IDB (well, the root binary)
        root_filename   = idaapi.get_root_filename()
        coverage_blocks = coverage_data.get_blocks_by_module(root_filename)

        # rebase the basic blocks
        base = idaapi.get_imagebase()
        rebased_blocks = rebase_blocks(base, coverage_blocks)

        # coalesce the blocks into larger contiguous blobs
        condensed_blocks = coalesce_blocks(rebased_blocks)

        # flatten the blobs into individual instructions or addresses
        return metadata.flatten_blocks(condensed_blocks)
bingrep_dump.py 文件源码 项目:bingrep 作者: hada2 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def main(function, f_image, f_all, f_overwrite):

    sys.setrecursionlimit(3000)

    program = idaapi.get_root_filename()
    start_time = time.time()
    cfgs = get_cfgs()
    dump_function_info(cfgs, program, function, f_image, f_all, f_overwrite)
    result_time = time.time() - start_time

    print "Dump finished."
    print "result_time: " + str(result_time) + " sec."
database.py 文件源码 项目:idascripts 作者: ctfhacker 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def filename():
    '''Returns the filename that the database was built from.'''
    return idaapi.get_root_filename()
idc.py 文件源码 项目:DecLLVM 作者: F8LEFT 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def GetInputFile():
    """
    Get input file name

    This function returns name of the file being disassembled
    """
    return idaapi.get_root_filename()
x64dbgida.py 文件源码 项目:IDAPython 作者: icspe 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def do_export():
    db = {}
    module = idaapi.get_root_filename().lower()
    base = idaapi.get_imagebase()

    file = AskFile(1, "x64dbg database|%s" % get_file_mask(),
                   "Export database")
    if not file:
        return
    print "Exporting database %s" % file

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

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

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

    with open(file, "w") as outfile:
        json.dump(db, outfile, indent=1)
    print "Exported database. Done!"



# 1) Create the handler class


问题


面经


文章

微信
公众号

扫码关注公众号