(self, kp_asm, address, assembly=None)
| 870 | class Keypatch_Form(idaapi.Form): |
| 871 | # prepare for form initializing |
| 872 | def setup(self, kp_asm, address, assembly=None): |
| 873 | self.kp_asm = kp_asm |
| 874 | self.address = address |
| 875 | |
| 876 | # update ordered list of arch and syntax |
| 877 | self.syntax_keys = self.kp_asm.dict_to_ordered_list(self.kp_asm.syntax_lists)[0] |
| 878 | self.arch_keys = self.kp_asm.dict_to_ordered_list(self.kp_asm.arch_lists)[0] |
| 879 | |
| 880 | # update current arch & mode |
| 881 | self.kp_asm.update_hardware_mode() |
| 882 | |
| 883 | # find right value for c_arch & c_endian controls |
| 884 | mode = self.kp_asm.mode |
| 885 | self.endian_id = 0 # little endian |
| 886 | if self.kp_asm.mode & KS_MODE_BIG_ENDIAN: |
| 887 | self.endian_id = 1 # big endian |
| 888 | mode = self.kp_asm.mode - KS_MODE_BIG_ENDIAN |
| 889 | |
| 890 | self.arch_id = self.kp_asm.find_arch_idx(self.kp_asm.arch, mode) |
| 891 | |
| 892 | self.syntax_id = 0 # to make non-X86 arch happy |
| 893 | if self.kp_asm.arch == KS_ARCH_X86: |
| 894 | self.syntax_id = self.kp_asm.find_syntax_idx(self.kp_asm.syntax) |
| 895 | |
| 896 | # get original instruction and bytes |
| 897 | self.orig_asm = kp_asm.ida_get_disasm(address) |
| 898 | (self.orig_encoding, self.orig_len) = kp_asm.ida_get_item(address, hex_output=True) |
| 899 | if self.orig_encoding == None: |
| 900 | self.orig_encoding = '' |
| 901 | |
| 902 | if assembly is None: |
| 903 | self.asm = self.kp_asm.ida_get_disasm(self.address, fixup=True) |
| 904 | else: |
| 905 | self.asm = assembly |
| 906 | |
| 907 | def __init__(self, kp_asm, address, assembly=None, patch_mode=False, opts=0): |
| 908 | pass |
no test coverage detected