(self,
                                                  values: Iterable[Union[claripy.ast.Base,int]],
                                                  definition: Definition,
                                                  cfg: CFGBase,
                                                  loader: Loader)
When a given definition holds concrete pointers, make sure the <MemoryLocation>s they point to are present in
        the dependency graph; Adds them if necessary.

        :param values:
        :param definition: The definition which has data that can contain concrete pointers.
        :param cfg: The CFG, containing information about memory data.
        :param loader:
When a given definition holds concrete pointers, make sure the <MemoryLocation>s they point to are present in
        the dependency graph; Adds them if necessary.
When a given definition holds concrete pointers make sure the <MemoryLocation > s they point to are present in the dependency graph ; Adds them if necessary .
def add_dependencies_for_concrete_pointers_of(self,
                                                  values: Iterable[Union[claripy.ast.Base,int]],
                                                  definition: Definition,
                                                  cfg: CFGBase,
                                                  loader: Loader):
        """
        When a given definition holds concrete pointers, make sure the <MemoryLocation>s they point to are present in
        the dependency graph; Adds them if necessary.

        :param values:
        :param definition: The definition which has data that can contain concrete pointers.
        :param cfg: The CFG, containing information about memory data.
        :param loader:
        """
        assert definition in self.nodes(), 'The given Definition must be present in the given graph.'

        known_predecessor_addresses = list(map(
            lambda definition: definition.atom.addr,
            filter(
                lambda p: isinstance(p.atom, MemoryLocation),
                self.predecessors(definition)
            )
        ))

        # concretize addresses where possible
        concrete_known_pred_addresses = []
        for address in known_predecessor_addresses:
            if isinstance(address, claripy.ast.Base):
                if address.concrete:
                    concrete_known_pred_addresses.append(address._model_concrete.value)
            else:
                concrete_known_pred_addresses.append(address)

        unknown_concrete_addresses: Set[int] = set()
        for v in values:
            if isinstance(v, claripy.ast.Base) and v.concrete:
                v = v._model_concrete.value
            if isinstance(v, int):
                if v not in concrete_known_pred_addresses:
                    unknown_concrete_addresses.add(v)

        for address in unknown_concrete_addresses:
            data_at_address = cfg.memory_data.get(address, None) if cfg is not None else None

            if data_at_address is None or data_at_address.sort not in ['string', 'unknown']: continue

            section = loader.main_object.find_section_containing(address)
            read_only = False if section is None else not section.is_writable
            code_location = \
                CodeLocation(0, 0, info={'readonly': True}) if read_only else ExternalCodeLocation()

            def _string_and_length_from(data_at_address):
                if data_at_address.content is None:
                    return UNDEFINED, data_at_address.size
                else:
                    return data_at_address.content.decode('utf-8'), data_at_address.size + 1
            _, string_length = _string_and_length_from(data_at_address)

            memory_location_definition = Definition(
                MemoryLocation(address, string_length),
                code_location,
            )

            self.graph.add_edge(memory_location_definition, definition)
def add_dependencies_for_concrete_pointers_of ( self , values : Iterable [ Union [ claripy . ast . Base , int ] ] , definition : Definition , cfg : CFGBase , loader : Loader ) : assert definition in self . nodes ( ) , 'The given Definition must be present in the given graph.' known_predecessor_addresses = list ( map ( lambda definition : definition . atom . addr , filter ( lambda p : isinstance ( p . atom , MemoryLocation ) , self . predecessors ( definition ) ) ) ) # concretize addresses where possible concrete_known_pred_addresses = [ ] for address in known_predecessor_addresses : if isinstance ( address , claripy . ast . Base ) : if address . concrete : concrete_known_pred_addresses . append ( address . _model_concrete . value ) else : concrete_known_pred_addresses . append ( address ) unknown_concrete_addresses : Set [ int ] = set ( ) for v in values : if isinstance ( v , claripy . ast . Base ) and v . concrete : v = v . _model_concrete . value if isinstance ( v , int ) : if v not in concrete_known_pred_addresses : unknown_concrete_addresses . add ( v ) for address in unknown_concrete_addresses : data_at_address = cfg . memory_data . get ( address , None ) if cfg is not None else None if data_at_address is None or data_at_address . sort not in [ 'string' , 'unknown' ] : continue section = loader . main_object . find_section_containing ( address ) read_only = False if section is None else not section . is_writable code_location = CodeLocation ( 0 , 0 , info = { 'readonly' : True } ) if read_only else ExternalCodeLocation ( ) def _string_and_length_from ( data_at_address ) : if data_at_address . content is None : return UNDEFINED , data_at_address . size else : return data_at_address . content . decode ( 'utf-8' ) , data_at_address . size + 1 _ , string_length = _string_and_length_from ( data_at_address ) memory_location_definition = Definition ( MemoryLocation ( address , string_length ) , code_location , ) self . graph . add_edge ( memory_location_definition , definition )