Python idaapi 模块,get_root_filename() 实例源码

我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用idaapi.get_root_filename()

项目:lighthouse    作者:gaasedelen    | 项目源码 | 文件源码
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    作者:hada2    | 项目源码 | 文件源码
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."
项目:idascripts    作者:ctfhacker    | 项目源码 | 文件源码
def filename():
    '''Returns the filename that the database was built from.'''
    return idaapi.get_root_filename()
项目:DecLLVM    作者:F8LEFT    | 项目源码 | 文件源码
def GetInputFile():
    """
    Get input file name

    This function returns name of the file being disassembled
    """
    return idaapi.get_root_filename()
项目:IDAPython    作者:icspe    | 项目源码 | 文件源码
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