import idc import idaapi import idautils startadd=0x00401040 for i in range(800): c=idc.get_wide_byte(startadd+i) idc.patch_byte(startadd+i, c^i)