:py:mod:`dissect.target.loaders.dir` ==================================== .. py:module:: dissect.target.loaders.dir Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: dissect.target.loaders.dir.DirLoader Functions ~~~~~~~~~ .. autoapisummary:: :nosignatures: dissect.target.loaders.dir.find_entry_path dissect.target.loaders.dir.map_dirs dissect.target.loaders.dir.find_and_map_dirs dissect.target.loaders.dir.find_dirs dissect.target.loaders.dir.os_type_from_path dissect.target.loaders.dir.is_drive_letter_path Attributes ~~~~~~~~~~ .. autoapisummary:: dissect.target.loaders.dir.PREFIXES .. py:data:: PREFIXES :value: ['', 'fs'] .. py:class:: DirLoader(path: pathlib.Path, **kwargs) Bases: :py:obj:`dissect.target.loader.Loader` Load a directory as a filesystem. .. py:method:: detect(path: pathlib.Path) -> bool :staticmethod: Detects wether this ``Loader`` class can load this specific ``path``. :param path: The target path to check. :returns: ``True`` if the ``path`` can be loaded by a ``Loader`` instance. ``False`` otherwise. .. py:method:: map(target: dissect.target.Target) -> None Maps the loaded path into a ``Target``. :param target: The target that we're mapping into. .. py:function:: find_entry_path(path: pathlib.Path) -> str | None .. py:function:: map_dirs(target: dissect.target.Target, dirs: list[pathlib.Path | tuple[str, pathlib.Path]], os_type: str, **kwargs) -> None Map directories as filesystems into the given target. :param target: The target to map into. :param dirs: The directories to map as filesystems. If a list member is a tuple, the first element is the drive letter. :param os_type: The operating system type, used to determine how the filesystem should be mounted. .. py:function:: find_and_map_dirs(target: dissect.target.Target, path: pathlib.Path, **kwargs) -> None Try to find and map directories as filesystems into the given target. :param target: The target to map into. :param path: The path to map from. :param \*\*kwargs: Optional arguments for :func:`loaderutil.add_virtual_ntfs_filesystem `. .. py:function:: find_dirs(path: pathlib.Path) -> tuple[str, list[pathlib.Path]] Try to find if ``path`` contains an operating system directory layout and return the OS type and detected directories. In the case of a Windows layout, try to find if there are directories for each drive letter and return them all. :param path: The path to check. :returns: A tuple consisting of the found operating system layout and a list of all detected directories. .. py:function:: os_type_from_path(path: pathlib.Path) -> dissect.target.plugin.OperatingSystem Try to detect what kind of operating system directory structure ``path`` contains. The operating system type is returned as a string. :param path: The path to check. :returns: The detected operating system type. .. py:function:: is_drive_letter_path(path: pathlib.Path) -> bool Check if a path can be a drive letter, e.g. ``C`` or ``C:``. :param path: The path to check. :returns: ``True`` if the path can be interpreted as a drive letter or ``False`` if it can't.