angr/storage/paged_memory.py
def replace_memory_object(self, old, new_content):
        """
        Replaces the memory object `old` with a new memory object containing `new_content`.

        :param old:         A SimMemoryObject (i.e., one from :func:`memory_objects_for_hash()` or :func:`
                            memory_objects_for_name()`).
        :param new_content: The content (claripy expression) for the new memory object.
        :returns: the new memory object
        """

        if (old.object.size() if not old.is_bytes else len(old.object)*self.state.arch.byte_width) != new_content.size():
            raise SimMemoryError("memory objects can only be replaced by the same length content")

        new = SimMemoryObject(new_content, old.base, byte_width=self.byte_width)
        for p in self._containing_pages_mo(old):
            self._get_page(p//self._page_size, write=True).replace_mo(self.state, old, new)

        if isinstance(new.object, claripy.ast.BV):
            for b in range(old.base, old.base+old.length):
                self._update_mappings(b, new.object)
        return new

        Replaces the memory object `old` with a new memory object containing `new_content`.

        :param old:         A SimMemoryObject (i.e., one from :func:`memory_objects_for_hash()` or :func:`
                            memory_objects_for_name()`).
        :param new_content: The content (claripy expression) for the new memory object.
        :returns: the new memory object
        
Replaces the memory object `old` with a new memory object containing `new_content`.
Replaces the memory object ` old ` with a new memory object containing ` new_content ` .
def replace_memory_object(self, old, new_content):
        if (old.object.size() if not old.is_bytes else len(old.object)*self.state.arch.byte_width) != new_content.size():
            raise SimMemoryError("memory objects can only be replaced by the same length content")
        new = SimMemoryObject(new_content, old.base, byte_width=self.byte_width)
        for p in self._containing_pages_mo(old):
            self._get_page(p//self._page_size, write=True).replace_mo(self.state, old, new)
        if isinstance(new.object, claripy.ast.BV):
            for b in range(old.base, old.base+old.length):
                self._update_mappings(b, new.object)
        return new
def replace_memory_object ( self , old , new_content ) : if ( old . object . size ( ) if not old . is_bytes else len ( old . object ) * self . state . arch . byte_width ) != new_content . size ( ) : raise SimMemoryError ( "memory objects can only be replaced by the same length content" ) new = SimMemoryObject ( new_content , old . base , byte_width = self . byte_width ) for p in self . _containing_pages_mo ( old ) : self . _get_page ( p // self . _page_size , write = True ) . replace_mo ( self . state , old , new ) if isinstance ( new . object , claripy . ast . BV ) : for b in range ( old . base , old . base + old . length ) : self . _update_mappings ( b , new . object ) return new
Replaces the memory object `old` with a new memory object containing `new_content`.
Replaces the memory object ` old ` with a new memory object containing ` new_content ` .
"""
        Replaces the memory object `old` with a new memory object containing `new_content`.

        :param old:         A SimMemoryObject (i.e., one from :func:`memory_objects_for_hash()` or :func:`
                            memory_objects_for_name()`).
        :param new_content: The content (claripy expression) for the new memory object.
        :returns: the new memory object
        """
the new memory object
the new memory object
self
old
A SimMemoryObject ` or :func:`
memory_objects_for_name()`).
A SimMemoryObject ` or : func : ` memory_objects_for_name () ` ) .
new_content
The content (claripy expression) for the new memory object.
The content ( claripy expression ) for the new memory object .