示例#1
0
def main():
    info('start')

    if idaapi.get_plugin_options("fn_fuzzy"):  # CLI (export only)
        start = time.time()
        options = idaapi.get_plugin_options("fn_fuzzy").split(':')
        #print options
        min_bytes = int(options[0])
        f_ex_libthunk = eval(options[1])
        f_update = eval(options[2])
        f_ana_exp = eval(options[3])
        ana_pre = options[4]
        db_path = ':'.join(options[5:])
        ff = FnFuzzy(False, db_path, min_bytes, f_ex_libthunk, f_update,
                     f_ana_exp, ana_pre)
        res = ff.export()
        ff.close()
        elapsed = time.time() - start
        info('done (CLI)')
        if res:  # return code 1 is reserved for error
            qexit(0)
        else:
            qexit(2)  # already exported (skipped)
    else:
        f = FnFuzzyForm()
        f.Compile()
        f.iDBSave.value = g_db_path
        f.iMinBytes.value = g_min_bytes
        f.iPrefix.value = g_analyzed_prefix
        f.iFolder.value = os.path.dirname(get_idb_path())
        f.iSimilarity.value = g_threshold
        f.iSimilarityCFG.value = g_threshold_cfg
        f.iMaxBytesForScore.value = g_max_bytes_for_score
        f.iRatio.value = g_bsize_ratio
        r = f.Execute()
        if r == 1:  # Run
            start = time.time()
            ff = FnFuzzy(f.cDebug.checked, f.iDBSave.value, f.iMinBytes.value,
                         f.cLibthunk.checked, f.cUpdate.checked,
                         f.cAnaExp.checked, f.iPrefix.value, f.cAnaCmp.checked,
                         f.cFolCmp.checked, f.iFolder.value,
                         f.iSimilarity.value, f.iSimilarityCFG.value,
                         f.iMaxBytesForScore.value, f.iRatio.value)
            if ff.sha256 is None:
                print 'aborted'
                return
            if f.rExport.selected:
                ff.export()
                #cProfile.runctx('ff.export()', None, locals())
            else:
                ff.compare()
                #cProfile.runctx('ff.compare()', None, locals())
            ff.close()
            elapsed = time.time() - start
        else:
            print 'canceled'
            return

    info('elapsed time = {} sec'.format(elapsed))
    info('done')
示例#2
0
def is_enabled():
    opts = idaapi.get_plugin_options("yaco")
    return not opts or "disable_plugin" not in opts.split(':')
示例#3
0
文件: decv.py 项目: DogBitesMe/decv
        s = h.dump()
        f.write(s)
    f.close()

def save_example(vmis):
    f = open(FN_EXAMPLE, "w")
    pickle.dump(vmis, f)
    f.close()

if __name__=="__main__":

    idaapi.autoWait()

    #should we close IDA after successful decompilation?
    die = False
    x = idaapi.get_plugin_options("die") #hax from http://accessomat.wordpress.com/2010/08/04/not-so-new-feature-on-ida-pro-5-7/
    if x == "1":
        die = True

    outfn = idaapi.get_plugin_options("outfn") 
    if not outfn:
        outfn = "deobfu.txt"
    
    print "-"*20
    print "DeCV 1.0b by p_k / twitter.com/pa_kt"
    print "-"*20
    
    print "normalizing operands...",
    norm_ops()
    print "done"
示例#4
0
def is_enabled():
    """ Get global status """
    opts = idaapi.get_plugin_options("yaco")
    return not opts or "disable_plugin" not in opts.split(':')
示例#5
0
文件: decv.py 项目: sourav-txt/decv

def save_example(vmis):
    f = open(FN_EXAMPLE, "w")
    pickle.dump(vmis, f)
    f.close()


if __name__ == "__main__":

    idaapi.autoWait()

    #should we close IDA after successful decompilation?
    die = False
    x = idaapi.get_plugin_options(
        "die"
    )  #hax from http://accessomat.wordpress.com/2010/08/04/not-so-new-feature-on-ida-pro-5-7/
    if x == "1":
        die = True

    outfn = idaapi.get_plugin_options("outfn")
    if not outfn:
        outfn = "deobfu.txt"

    print "-" * 20
    print "DeCV 1.0b by p_k / twitter.com/pa_kt"
    print "-" * 20

    print "normalizing operands...",
    norm_ops()
    print "done"