dissect.target.loaders.dir¶
Module Contents¶
Classes¶
Load a directory as a filesystem. |
Functions¶
Map directories as filesystems into the given target. |
|
Try to find and map directories as filesystems into the given target. |
|
Try to find if |
|
Try to detect what kind of operating system directory structure |
|
Check if a path can be a drive letter, e.g. |
Attributes¶
- dissect.target.loaders.dir.PREFIXES = ['', 'fs']¶
- class dissect.target.loaders.dir.DirLoader(path: pathlib.Path, *, parsed_path: urllib.parse.ParseResult | None = None, resolve: bool = True, **kwargs)¶
Bases:
dissect.target.loader.LoaderLoad a directory as a filesystem.
- static detect(path: pathlib.Path) bool¶
Detects wether this
Loaderclass can load this specificpath.- Parameters:
path – The target path to check.
- Returns:
Trueif thepathcan be loaded by aLoaderinstance.Falseotherwise.
- map(target: dissect.target.target.Target) None¶
Maps the loaded path into a
Target.- Parameters:
target – The target that we’re mapping into.
- dissect.target.loaders.dir.find_entry_path(path: pathlib.Path) str | None¶
- dissect.target.loaders.dir.map_dirs(target: dissect.target.target.Target, dirs: list[pathlib.Path | tuple[str, pathlib.Path]], os_type: str, *, dirfs: type[dissect.target.filesystems.dir.DirectoryFilesystem] = DirectoryFilesystem, zipfs: type[dissect.target.filesystems.zip.ZipFilesystem] = ZipFilesystem, **kwargs) None¶
Map directories as filesystems into the given target.
- Parameters:
target – The target to map into.
dirs – The directories to map as filesystems. If a list member is a tuple, the first element is the drive letter.
os_type – The operating system type, used to determine how the filesystem should be mounted.
dirfs – The filesystem class to use for directory filesystems.
zipfs – The filesystem class to use for ZIP filesystems.
- dissect.target.loaders.dir.find_and_map_dirs(target: dissect.target.target.Target, path: pathlib.Path, **kwargs) None¶
Try to find and map directories as filesystems into the given target.
- Parameters:
target – The target to map into.
path – The path to map from. If path is a local path, must be provided as an absolute path in order to work with
target-mount.**kwargs – Optional arguments for
loaderutil.add_virtual_ntfs_filesystem.
- dissect.target.loaders.dir.find_dirs(path: pathlib.Path) tuple[str, list[pathlib.Path]]¶
Try to find if
pathcontains 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.
- Parameters:
path – The path to check.
- Returns:
A tuple consisting of the found operating system layout and a list of all detected directories.
- dissect.target.loaders.dir.os_type_from_path(path: pathlib.Path) dissect.target.plugin.OperatingSystem¶
Try to detect what kind of operating system directory structure
pathcontains.The operating system type is returned as a string.
- Parameters:
path – The path to check.
- Returns:
The detected operating system type.
- dissect.target.loaders.dir.is_drive_letter_path(path: pathlib.Path) bool¶
Check if a path can be a drive letter, e.g.
CorC:.- Parameters:
path – The path to check.
- Returns:
Trueif the path can be interpreted as a drive letter orFalseif it can’t.