IDA Scripts

#自动查找函数头并尽可能的识别为函数
def make_function(opcodes, align=1):
    start_ea = ida_ida.inf_get_min_ea()
    while (start_ea = 0):
        procea = idc.find_binary(start_ea, SEARCH_DOWN, opcodes)
        if (procea == idaapi.BADADDR):
            break

        start_ea = procea + 1
        if (procea % 2) == align:
            flags = ida_bytes.get_flags(procea-align)
            if ida_bytes.is_unknown(flags):
                ida_auto.auto_make_proc(procea-align)
                msg("%s: %X\n" % (opcodes, procea-align))

            func = ida_funcs.get_func(procea)
            if func != None:
                
Read More