def code_search(ea, val): """Search forward for the next occurance of val. Return None if no match.""" res = idc.FindBinary(ea, idc.SEARCH_DOWN, val) if res == idaapi.BADADDR: return None else: return res