def _step(self, instruction):
logger.debug("<STR_LIT>"<EOL>% (instruction.address, instruction.mnemonic, instruction.op_str))<EOL>registers = set(self._cpu.canonical_registers)<EOL>if self._cpu.arch == CS_ARCH_X86:<EOL><INDENT>registers -= set(['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'])<EOL>registers.add('<STR_LIT>')<EOL>registers -= set(['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'])<EOL>registers |= set(['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>'])<EOL><DEDENT>for reg in registers:<EOL><INDENT>val = self._cpu.read_register(reg)<EOL>if issymbolic(val):<EOL><INDENT>from ..native.cpu.abstractcpu import ConcretizeRegister<EOL>raise ConcretizeRegister(self._cpu, reg, "<STR_LIT>",<EOL>policy='<STR_LIT>')<EOL><DEDENT>self._emu.reg_write(self._to_unicorn_id(reg), val)<EOL><DEDENT>instruction = self._cpu.decode_instruction(self._cpu.PC)<EOL>text_bytes = self._cpu.read_bytes(self._cpu.PC, instruction.size)<EOL>self._emu.mem_write(self._cpu.PC, b'<STR_LIT>'.join(text_bytes))<EOL>self._emu.hook_add(UC_HOOK_MEM_READ_UNMAPPED, self._hook_unmapped)<EOL>self._emu.hook_add(UC_HOOK_MEM_WRITE_UNMAPPED, self._hook_unmapped)<EOL>self._emu.hook_add(UC_HOOK_MEM_FETCH_UNMAPPED, self._hook_unmapped)<EOL>self._emu.hook_add(UC_HOOK_MEM_READ, self._hook_xfer_mem)<EOL>self._emu.hook_add(UC_HOOK_MEM_WRITE, self._hook_xfer_mem)<EOL>self._emu.hook_add(UC_HOOK_INTR, self._interrupt)<EOL>saved_PC = self._cpu.PC<EOL>try:<EOL><INDENT>pc = self._cpu.PC<EOL>if self._cpu.arch == CS_ARCH_ARM and self._uc_mode == UC_MODE_THUMB:<EOL><INDENT>pc |= <NUM_LIT:1><EOL><DEDENT>self._emu.emu_start(pc, self._cpu.PC + instruction.size, count=<NUM_LIT:1>)<EOL><DEDENT>except UcError as e:<EOL><INDENT>if not self._should_try_again:<EOL><INDENT>raise<EOL><DEDENT><DEDENT>if self._should_try_again:<EOL><INDENT>return<EOL><DEDENT>if logger.isEnabledFor(logging.DEBUG):<EOL><INDENT>logger.debug("<STR_LIT:=>" * <NUM_LIT:10>)<EOL>for register in self._cpu.canonical_registers:<EOL><INDENT>logger.debug(<EOL>f"<STR_LIT>"<EOL>f"<STR_LIT>"<EOL>f"<STR_LIT>"<EOL>)<EOL><DEDENT>logger.debug("<STR_LIT:>>" * <NUM_LIT:10>)<EOL><DEDENT>for reg in registers:<EOL><INDENT>val = self._emu.reg_read(self._to_unicorn_id(reg))<EOL>self._cpu.write_register(reg, val)<EOL><DEDENT>mu_pc = self.get_unicorn_pc()<EOL>if saved_PC == mu_pc:<EOL><INDENT>self._cpu.PC = saved_PC + instruction.size<EOL><DEDENT>if self._to_raise:<EOL><INDENT>raise self._to_raise<EOL><DEDENT>return<EOL>
A single attempt at executing an instruction.