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, **kwargs)#
Bases:
dissect.target.loader.Loader
Load a directory as a filesystem.
- static detect(path: pathlib.Path) bool #
Detects wether this
Loader
class can load this specificpath
.- Parameters:
path – The target path to check.
- Returns:
True
if thepath
can be loaded by aLoader
instance.False
otherwise.
- map(target: dissect.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, dirs: list[pathlib.Path], os_type: str, **kwargs) None #
Map directories as filesystems into the given target.
- Parameters:
target – The target to map into.
dirs – The directories to map as filesystems.
os_type – The operating system type, used to determine how the filesystem should be mounted.
- dissect.target.loaders.dir.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.
- Parameters:
target – The target to map into.
path – The path to map from.
**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
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.
- 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
path
contains.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.
C
orC:
.- Parameters:
path – The path to check.
- Returns:
True
if the path can be interpreted as a drive letter orFalse
if it can’t.