def simulate(self, iaddr: str, simstate: "X86SimulationState") -> None: ecxval = simstate.get_regval(iaddr, 'ecx') if ecxval.is_literal: ecxval = cast(SV.SimLiteralValue, ecxval) newval = ecxval.sub(SV.simOne) simstate.set_register(iaddr, 'ecx', newval) tgtaddr = str(self.target_address) if newval.value != 0: raise SU.CHBSimJumpException(iaddr, tgtaddr) raise SU.CHBSimFallthroughException(iaddr, tgtaddr) else: raise SU.CHBSimError(simstate, iaddr, "Loop cannot be applied to " + str(ecxval))
def simulate(self, iaddr: str, simstate: "X86SimulationState") -> None: raise SU.CHBSimJumpException(iaddr, str(self.target_address))