diff --git a/dissect/target/loaders/log.py b/dissect/target/loaders/log.py index 9d5520bde..69eaef19d 100644 --- a/dissect/target/loaders/log.py +++ b/dissect/target/loaders/log.py @@ -6,6 +6,17 @@ from dissect.target.filesystem import VirtualFilesystem from dissect.target.loader import Loader +DROP_FILE_DIR = "sysvol/drop/" + + +def dropfolder(target: Target, pattern: str): + """Convience function, usage: + + for data_file in dropfolder(target, "*.data"): + self._plugin_files.append(data_file) + """ + return target.fs.path(DROP_FILE_DIR).glob(pattern) + class LogLoader(Loader): LOGS_DIRS = { @@ -29,7 +40,7 @@ def map(self, target: Target) -> None: vfs = VirtualFilesystem(case_sensitive=False) for entry in self.path.parent.glob(self.path.name): ext = self.options.get("hint", entry.suffix.lower()).strip(".") - if (mapping := self.LOGS_DIRS.get(ext, None)) is None: + if (mapping := self.LOGS_DIRS.get(ext, DROP_FILE_DIR)) is None: continue mapping = str(Path(mapping).joinpath(entry.name)) vfs.map_file(mapping, str(entry))