re-implement grep for ROP