(self)
Execute a p-code conditional branch operation.
Execute a p-code conditional branch operation.
Execute a p - code conditional branch operation .
def _execute_cbranch(self) -> None:
        """
        Execute a p-code conditional branch operation.
        """
        cond = self._get_value(self._current_op.inputs[1])
        dest_addr = self._current_op.inputs[0].get_addr()
        if dest_addr.is_constant:
            raise NotImplementedError("p-code relative branch not supported yet")

        exit_state = self.state.copy()
        self.successors.add_successor(
            exit_state,
            dest_addr.offset,
            cond != 0,
            "Ijk_Boring",
            exit_stmt_idx=DEFAULT_STATEMENT,
            exit_ins_addr=self.state.scratch.ins_addr,
        )

        cont_state = self.state
        cont_condition = cond == 0
        cont_state.add_constraints(cont_condition)
        cont_state.scratch.guard = claripy.And(
            cont_state.scratch.guard, cont_condition
        )
def _execute_cbranch ( self ) -> None : cond = self . _get_value ( self . _current_op . inputs [ 1 ] ) dest_addr = self . _current_op . inputs [ 0 ] . get_addr ( ) if dest_addr . is_constant : raise NotImplementedError ( "p-code relative branch not supported yet" ) exit_state = self . state . copy ( ) self . successors . add_successor ( exit_state , dest_addr . offset , cond != 0 , "Ijk_Boring" , exit_stmt_idx = DEFAULT_STATEMENT , exit_ins_addr = self . state . scratch . ins_addr , ) cont_state = self . state cont_condition = cond == 0 cont_state . add_constraints ( cont_condition ) cont_state . scratch . guard = claripy . And ( cont_state . scratch . guard , cont_condition )