| 1585 | |
| 1586 | # handler for Undo menu |
| 1587 | def undo(self): |
| 1588 | global patch_info |
| 1589 | if len(patch_info) == 0: |
| 1590 | # TODO: disable Undo menu? |
| 1591 | idc.Warning("ERROR: Keypatch already got to the last undo patching!") |
| 1592 | else: |
| 1593 | (address, assembly, p_orig_data, patch_comment) = patch_info[-1] |
| 1594 | |
| 1595 | # undo the patch |
| 1596 | self.kp_asm.patch_code(address, None, None, None, None, orig_asm=[assembly], patch_data=p_orig_data, patch_comment=patch_comment, undo=True) |
| 1597 | del(patch_info[-1]) |
| 1598 | |
| 1599 | # handler for Search menu |
| 1600 | def search(self): |