當前位置: 首頁>>代碼示例>>Python>>正文


Python idc.AskFile方法代碼示例

本文整理匯總了Python中idc.AskFile方法的典型用法代碼示例。如果您正苦於以下問題:Python idc.AskFile方法的具體用法?Python idc.AskFile怎麽用?Python idc.AskFile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在idc的用法示例。


在下文中一共展示了idc.AskFile方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: load_db

# 需要導入模塊: import idc [as 別名]
# 或者: from idc import AskFile [as 別名]
def load_db(self):
        try:
            db_file = idc.AskFile(0, "*.ddb", "Load DIE Db File")
            if db_file is not None:
                self.die_db.load_db(db_file)

            if self.die_db is not None:
                self.show_db_details()

        except DbFileMismatch as mismatch:
            idaapi.msg("Error while loading DIE DB: %s\n" % mismatch)

        except Exception as ex:
            logging.exception("Error while loading DB: %s", ex)
            return False


    ###########################################################################
    # Function View 
開發者ID:ynvb,項目名稱:DIE,代碼行數:21,代碼來源:DIE.py

示例2: on_export

# 需要導入模塊: import idc [as 別名]
# 或者: from idc import AskFile [as 別名]
def on_export(self):
        Warning("This export option generates an .ivz file that you have to distribute manually.\nIDASynergy won't automatically synchronize unless a local repository is synched\nto a versioning server and the 'IDASynergy SVN Commit' menu option is used.")
        exp_file = idc.AskFile(1, "*.ivz", "Exported data filename")
        print time.time()
        self.remove_hooks()
        self.data_io.export_to_file(exp_file)
        self.insert_hooks()
        return 1 
開發者ID:CubicaLabs,項目名稱:IDASynergy,代碼行數:10,代碼來源:IDASynergy.py

示例3: on_import

# 需要導入模塊: import idc [as 別名]
# 或者: from idc import AskFile [as 別名]
def on_import(self):
        imp_file = idc.AskFile(0, "*.ivz", "Select file to import")
        self.remove_hooks()
        self.data_io.import_from_file(imp_file, self.insert_hooks)
        return 1 
開發者ID:CubicaLabs,項目名稱:IDASynergy,代碼行數:7,代碼來源:IDASynergy.py

示例4: save_db

# 需要導入模塊: import idc [as 別名]
# 或者: from idc import AskFile [as 別名]
def save_db(self):
        db_file = idc.AskFile(1, "*.ddb", "Save DIE Db File")
        if db_file is None:
            return

        self.die_db.save_db(db_file) 
開發者ID:ynvb,項目名稱:DIE,代碼行數:8,代碼來源:DIE.py

示例5: importb

# 需要導入模塊: import idc [as 別名]
# 或者: from idc import AskFile [as 別名]
def importb(self):
        #將文件中的內容導入到buffer中
        fileName = idc.AskFile(0, "*.*", 'Import File')
        try:
            self.buffer = open(fileName, 'rb').read()
        except:
            sys.stdout.write('ERROR:Cannot access file') 
開發者ID:ExpLife0011,項目名稱:IDAPython_Note,代碼行數:9,代碼來源:16_輸入與輸出.py

示例6: export

# 需要導入模塊: import idc [as 別名]
# 或者: from idc import AskFile [as 別名]
def export(self):
        #將所選擇的buffer保存到文件
        exportFile = idc.AskFile(1, "*.*", "Export Buffer")
        f = open(exportFile, 'wb')
        f.write(self.buffer)
        f.close() 
開發者ID:ExpLife0011,項目名稱:IDAPython_Note,代碼行數:8,代碼來源:16_輸入與輸出.py

示例7: run

# 需要導入模塊: import idc [as 別名]
# 或者: from idc import AskFile [as 別名]
def run(self):
        '''Public function.'''

        self.symbol_path = idc.AskFile(0, '*.pdb', 'Choose PDB file...')
        self.image_base = idaapi.get_imagebase()

        print "IPL: Loading PDB data, might take a while..."
        self.PDBLookup = pdbparse.symlookup.Lookup([(self.symbol_path, self.image_base)])

        if not self.PDBLookup:
            print "IPL: PDBLookup failed to initialize, exiting."
            return

        self._rename_functions()
        return 
開發者ID:ax330d,項目名稱:ida_pdb_loader,代碼行數:17,代碼來源:main.py

示例8: main

# 需要導入模塊: import idc [as 別名]
# 或者: from idc import AskFile [as 別名]
def main():
    message = "First of all you need to specify folder with test cases."
    idc.Warning(message)
    fname = idc.AskFile(0, "*.*", "Please specify first trace file in test cases folder \
                                   to start prioritization")
    if fname == None:
        print "You need to specify any file in test cases folder to start prioritization"
        return 0
    fname = os.path.dirname(fname)
    if fname == None:
        return 0
    print "Starting prioritization of " + fname
    start_prior(fname)
    print "Done" 
開發者ID:mxmssh,項目名稱:IDAmetrics,代碼行數:16,代碼來源:sorter.py

示例9: prepare

# 需要導入模塊: import idc [as 別名]
# 或者: from idc import AskFile [as 別名]
def prepare(metrics_used):
    fname = idc.AskFile(0, ".out", "Choose a trace file")
    if fname == None:
        print "You need to specify trace to get dynamic metrics"
        return 0
    print "Start trace analysis"

    metrics_dynamic = Metrics_dynamic()
    metrics_dynamic.get_dynamic_metrics(fname, metrics_used) 
開發者ID:mxmssh,項目名稱:IDAmetrics,代碼行數:11,代碼來源:IDAMetrics_dynamic.py

示例10: run

# 需要導入模塊: import idc [as 別名]
# 或者: from idc import AskFile [as 別名]
def run(self):
        try:
            logger.debug("Starting up")
            dbFile = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', 'shellcode_hashes', 'sc_hashes.db'))
            logger.debug('Trying default db path: %s', dbFile)
            if not os.path.exists(dbFile):
                if using_ida7api:
                    dbFile = idaapi.ask_file(False, "*.db", "Select shellcode hash database")
                else:
                    dbFile = idc.AskFile(0, "*.db", "Select shellcode hash database")

                if (dbFile is None) or (not os.path.isfile(dbFile)):
                    logger.debug("No file select. Stopping now")
                    return
            self.dbstore = DbStore(dbFile)
            logger.debug("Loaded db file: %s", dbFile)
            if QT_AVAILABLE:
                self.launchGuiInput()
            else:
                self.launchManualPrompts() 
            searcher = ShellcodeHashSearcher(self.dbstore, self.params)
            logger.debug('Starting to run the searcher now')
            searcher.run()
            logger.debug("Done")
        except RejectionException:
            logger.info('User canceled action')
        except Exception as err:
            logger.exception("Exception caught: %s", str(err)) 
開發者ID:fireeye,項目名稱:flare-ida,代碼行數:30,代碼來源:shellcode_hash_search.py

示例11: getInputFilepath

# 需要導入模塊: import idc [as 別名]
# 或者: from idc import AskFile [as 別名]
def getInputFilepath():
    '''Returns None if the uesr cancels. Updates the filepath in the idb on success'''
    if using_ida7api:
        return getInputFilepath_ida7()
    filePath = idc.GetInputFilePath()
    if not os.path.exists(filePath):
        print ('IDB input file not found. Prompting for new one: %s' % filePath)
        filePath = idc.AskFile(False, '*.*', 'Enter path to idb input file')
        if filePath is not None:
            idc.SetInputFilePath(filePath)
    return filePath 
開發者ID:fireeye,項目名稱:flare-ida,代碼行數:13,代碼來源:jayutils.py

示例12: main

# 需要導入模塊: import idc [as 別名]
# 或者: from idc import AskFile [as 別名]
def main():
    if _IN_IDA:
        # # get dyld_shared_cache path from IDA's openFile dialog
        print "[+] Please choose the original dyld_shared_cache_arm64"
        dsc_path = idc.AskFile(0, "*.*", "dyld shared cache file")
    else:
        dsc_path = sys.argv[1]

    if not dsc_path or not os.path.exists(dsc_path):
        raise RuntimeError("Couldn't find the dyld shared cache file..")

    print "[+] about to parse %s.." % (dsc_path)
    dsc_file = open(dsc_path, "rb")
    adrfind = AddrFinder(dsc_file, cache_symbols=False)
    map_shared_bridges(dsc_file, adrfind)
    if _IN_IDA:
        addresses = sorted(set(get_bad_addresses()))
    else:
        addresses = sorted(set(eval(open("addrs.txt", "rb").read())))

    segments, exports = get_segments_and_exports_for_addresses(addresses, adrfind)
    # segments = join_neighbors(segments, threshold=0x1000)
    if _IN_IDA:
        map_segments(segments, dsc_file)
        map_exports(exports)
        idaapi.analyze_area(idc.MinEA(), idc.MaxEA()) 
開發者ID:deepinstinct,項目名稱:dsc_fix,代碼行數:28,代碼來源:dsc_fix.py


注:本文中的idc.AskFile方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。