Example #1
0
 def get_disk_type(self):
     if _util.is_encase(self.paths[0]):
         return 'encase'
     elif _util.is_vmware(self.paths[0]):
         return 'vmdk'
     elif _util.is_compressed(self.paths[0]):
         return 'compressed'
     else:
         return 'dd'
Example #2
0
 def get_disk_type(self):
     if _util.is_encase(self.paths[0]):
         return "encase"
     elif _util.is_vmware(self.paths[0]):
         return "vmdk"
     elif _util.is_compressed(self.paths[0]):
         return "compressed"
     else:
         return "dd"
Example #3
0
 def get_disk_type(self):
     if _util.is_encase(self.paths[0]):
         return 'encase'
     elif _util.is_vmware(self.paths[0]):
         return 'vmdk'
     elif _util.is_compressed(self.paths[0]):
         return 'compressed'
     else:
         return 'dd'
Example #4
0
    def __init__(self, parser, path, offset=0, vstype='detect', read_write=False, method='auto', detection='auto',
                 multifile=True, index=None, mount_directories=True, **args):
        """Instantiation of this class does not automatically mount, detect or analyse the disk. You will need the
        :func:`init` method for this.

        :param parser: the parent parser
        :type parser: :class:`ImageParser`
        :param int offset: offset of the disk where the volume (system) resides
        :param str vstype: the volume system type
        :param bool read_write: indicates whether the disk should be mounted with a read-write cache enabled
        :param str method: the method to mount the base image with
        :param str detection: the method to detect volumes in the volume system with
        :param bool multifile: indicates whether :func:`mount` should attempt to call the underlying mount method with
                all files of a split file when passing a single file does not work
        :param str index: the base index of this Disk
        :param bool mount_directories: indicates whether directories should also be 'mounted'
        :param args: arguments that should be passed down to :class:`Volume` objects
        """

        self.parser = parser

        # Find the type and the paths
        path = os.path.expandvars(os.path.expanduser(path))
        if _util.is_encase(path):
            self.type = 'encase'
        elif _util.is_vmware(path):
            self.type = 'vmdk'
        elif _util.is_compressed(path):
            self.type = 'compressed'
        else:
            self.type = 'dd'
        self.paths = sorted(_util.expand_path(path))

        self.offset = offset
        self.vstype = vstype.lower()

        self.block_size = BLOCK_SIZE

        self.read_write = read_write

        self.method = method

        if detection == 'auto':
            if _util.module_exists('pytsk3'):
                self.detection = 'pytsk3'
            elif _util.command_exists('mmls'):
                self.detection = 'mmls'
            else:
                self.detection = 'parted'
        else:
            self.detection = detection

        self.read_write = read_write
        self.rwpath = ""
        self.multifile = multifile
        self.index = index
        self.mount_directories = mount_directories
        self.args = args

        self.name = os.path.split(path)[1]
        self.mountpoint = ''
        self.avfs_mountpoint = ''
        self.volumes = []
        self.volume_source = ""

        self._disktype = defaultdict(dict)

        self.loopback = ""
        self.md_device = ""