(self, addr, strategies, action, condition)
Applies concretization strategies on the address until one of them succeeds.
Applies concretization strategies on the address until one of them succeeds.
Applies concretization strategies on the address until one of them succeeds .
def _apply_concretization_strategies(self, addr, strategies, action, condition):
        """
        Applies concretization strategies on the address until one of them succeeds.
        """

        # we try all the strategies in order
        for s in strategies:
            # first, we trigger the SimInspect breakpoint and give it a chance to intervene
            e = addr
            self.state._inspect(
                'address_concretization', BP_BEFORE, address_concretization_strategy=s,
                address_concretization_action=action, address_concretization_memory=self,
                address_concretization_expr=e, address_concretization_add_constraints=True
            )
            s = self.state._inspect_getattr('address_concretization_strategy', s)
            e = self.state._inspect_getattr('address_concretization_expr', addr)

            # if the breakpoint None'd out the strategy, we skip it
            if s is None:
                continue

            # let's try to apply it!
            try:
                a = s.concretize(self, e, extra_constraints=(condition,) if condition is not None else ())
            except SimUnsatError:
                a = None

            # trigger the AFTER breakpoint and give it a chance to intervene
            self.state._inspect(
                'address_concretization', BP_AFTER,
                address_concretization_result=a
            )
            a = self.state._inspect_getattr('address_concretization_result', a)

            # return the result if not None!
            if a is not None:
                return a

        # well, we tried
        raise SimMemoryAddressError(
            "Unable to concretize address for %s with the provided strategies." % action
        )
def _apply_concretization_strategies ( self , addr , strategies , action , condition ) : # we try all the strategies in order for s in strategies : # first, we trigger the SimInspect breakpoint and give it a chance to intervene e = addr self . state . _inspect ( 'address_concretization' , BP_BEFORE , address_concretization_strategy = s , address_concretization_action = action , address_concretization_memory = self , address_concretization_expr = e , address_concretization_add_constraints = True ) s = self . state . _inspect_getattr ( 'address_concretization_strategy' , s ) e = self . state . _inspect_getattr ( 'address_concretization_expr' , addr ) # if the breakpoint None'd out the strategy, we skip it if s is None : continue # let's try to apply it! try : a = s . concretize ( self , e , extra_constraints = ( condition , ) if condition is not None else ( ) ) except SimUnsatError : a = None # trigger the AFTER breakpoint and give it a chance to intervene self . state . _inspect ( 'address_concretization' , BP_AFTER , address_concretization_result = a ) a = self . state . _inspect_getattr ( 'address_concretization_result' , a ) # return the result if not None! if a is not None : return a # well, we tried raise SimMemoryAddressError ( "Unable to concretize address for %s with the provided strategies." % action )