(self, new_size)
Reduce the size of this block

        :param int new_size: The new size
        :return: None
Reduce the size of this block
Reduce the size of this block
def shrink(self, new_size):
        """
        Reduce the size of this block

        :param int new_size: The new size
        :return: None
        """
        self.size = new_size

        if self.sort == MemoryDataSort.String:
            self.null_terminated = False # string without the null byte terminator
            self._content[0] = self._content[0][ : self.size]

        elif self.sort == MemoryDataSort.PointerArray:
            pointer_size = self.binary.project.arch.bytes

            if self.size % pointer_size != 0:
                # it's not aligned?
                raise BinaryError('Fails at Data.shrink()')

            pointers = self.size // pointer_size
            self._content = self._content[ : pointers]

        else:
            # unknown
            self._content =  [ self._content[0][ : self.size ] ]
def shrink ( self , new_size ) : self . size = new_size if self . sort == MemoryDataSort . String : self . null_terminated = False # string without the null byte terminator self . _content [ 0 ] = self . _content [ 0 ] [ : self . size ] elif self . sort == MemoryDataSort . PointerArray : pointer_size = self . binary . project . arch . bytes if self . size % pointer_size != 0 : # it's not aligned? raise BinaryError ( 'Fails at Data.shrink()' ) pointers = self . size // pointer_size self . _content = self . _content [ : pointers ] else : # unknown self . _content = [ self . _content [ 0 ] [ : self . size ] ]