dissect.target 3.11.dev29__py3-none-any.whl → 3.11.dev31__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
dissect/target/loader.py CHANGED
@@ -198,3 +198,4 @@ register("log", "LogLoader")
198
198
  # register("res", "ResLoader")
199
199
  register("phobos", "PhobosLoader")
200
200
  register("velociraptor", "VelociraptorLoader")
201
+ register("multiraw", "MultiRawLoader") # Should be last
@@ -0,0 +1,34 @@
1
+ from pathlib import Path
2
+
3
+ from dissect.target import container
4
+ from dissect.target.helpers.fsutil import TargetPath
5
+ from dissect.target.loader import Loader
6
+ from dissect.target.target import Target
7
+
8
+
9
+ class MultiRawLoader(Loader):
10
+ """Load multiple raw containers as a single target (i.e. a multi-disk system).
11
+
12
+ Use as ``/path/to/disk1+/path/to/disk2`` to load a single target with two disks.
13
+ The disks can be anything that Dissect supports such as EWF, VMDK, etc.
14
+ """
15
+
16
+ @staticmethod
17
+ def detect(path: Path) -> bool:
18
+ if not path.exists() and "+" in str(path):
19
+ return all(p.exists() for p in _split_paths(path))
20
+
21
+ return False
22
+
23
+ def map(self, target: Target) -> None:
24
+ for subpath in _split_paths(self.path):
25
+ target.disks.add(container.open(subpath))
26
+
27
+
28
+ def _split_paths(path: Path) -> list[Path]:
29
+ if isinstance(path, TargetPath):
30
+ root = path.joinpath("/")
31
+ else:
32
+ root = path.cwd()
33
+
34
+ return [root.joinpath(subpath) for subpath in str(path).split("+")]
@@ -12,7 +12,6 @@ from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Type, U
12
12
  from dissect.target import Target
13
13
  from dissect.target.exceptions import UnsupportedPluginError
14
14
  from dissect.target.helpers import docs, keychain
15
- from dissect.target.loaders.targetd import TargetdLoader
16
15
  from dissect.target.plugin import (
17
16
  OSPlugin,
18
17
  Plugin,
@@ -134,7 +133,7 @@ def generate_argparse_for_plugin(
134
133
 
135
134
 
136
135
  def plugin_factory(target: Target, plugin: Union[type, object], funcname: str) -> tuple[Plugin, str]:
137
- if TargetdLoader.instance:
136
+ if hasattr(target, "instance"):
138
137
  return target.get_function(funcname)
139
138
 
140
139
  if isinstance(plugin, type):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dissect.target
3
- Version: 3.11.dev29
3
+ Version: 3.11.dev31
4
4
  Summary: This module ties all other Dissect modules together, it provides a programming API and command line tools which allow easy access to various data sources inside disk images or file collections (a.k.a. targets)
5
5
  Author-email: Dissect Team <dissect@fox-it.com>
6
6
  License: Affero General Public License v3
@@ -2,7 +2,7 @@ dissect/target/__init__.py,sha256=Oc7ounTgq2hE4nR6YcNabetc7SQA40ldSa35VEdZcQU,63
2
2
  dissect/target/container.py,sha256=R8M9EE7DqKq8DeMuekcpR1nxtZ827zuqmTmO4s7PYkg,7730
3
3
  dissect/target/exceptions.py,sha256=DQVgo6puVBRPBiappL9GU5EA94lrcr3eVta0m56a-ng,2777
4
4
  dissect/target/filesystem.py,sha256=Kn9RJtdYUWRXh4hxGnHpN_ttwcslZpwzVtUvX_W7qIQ,49335
5
- dissect/target/loader.py,sha256=uQ-uclbiJgzcWWXQdcMjNjossyjo9xlYsM2W0Qfk0v4,7043
5
+ dissect/target/loader.py,sha256=oTpNhmb2abgWuPUqdewLjZz2zcbSYQP5kzZ5yYu7XXg,7100
6
6
  dissect/target/plugin.py,sha256=1AZDXM4BuutW4fD6ghuFFl61dy2hWSTkTyUjTQGPWM8,32533
7
7
  dissect/target/report.py,sha256=06uiP4MbNI8cWMVrC1SasNS-Yg6ptjVjckwj8Yhe0Js,7958
8
8
  dissect/target/target.py,sha256=TgDY-yAsReOQOG-Phz_m1vdNucdbk9fUI_RMZpMeYG8,28334
@@ -64,6 +64,7 @@ dissect/target/loaders/itunes.py,sha256=69aMTQiiGYpmD_EYSmf9mO1re8C3jAZIEStmwlMx
64
64
  dissect/target/loaders/kape.py,sha256=t5TfrGLqPeIpUUpXzIl6aHsqXMEGDqJ5YwDCs07DiBA,1237
65
65
  dissect/target/loaders/local.py,sha256=tZLpcvbKd70N9KU1eb1P1BCXtwaM7RJ9YP8PKct7xyU,15573
66
66
  dissect/target/loaders/log.py,sha256=_Mo44icM_4qQ05pjgcowrSnLeUHkwAGVYlYrHiIXLJw,1234
67
+ dissect/target/loaders/multiraw.py,sha256=4a3ZST0NwjnfPDxHkcEfAcX2ddUlT_C-rcrMHNg1wp4,1046
67
68
  dissect/target/loaders/ovf.py,sha256=ro1F9Gr3ta5dgov483twzine9_Sw6hwZoILz2srHJI0,1069
68
69
  dissect/target/loaders/phobos.py,sha256=XtxF7FZXfZrXJruFUZUQzxlREyfc86dTxph7BNoNMvw,2277
69
70
  dissect/target/loaders/profile.py,sha256=5ylgmzEEGyBFW3izvb-BZ7dGByXN9OFyRnnggR98P9w,1667
@@ -264,7 +265,7 @@ dissect/target/tools/mount.py,sha256=88U_Q_0RVB8gaQGsC0vf-rY0UoBBGYgKmqopqWNlytc
264
265
  dissect/target/tools/query.py,sha256=6wVZsIlRMoGR04bh792aynTZbX5EyrTyNfvRBhWmurc,13530
265
266
  dissect/target/tools/reg.py,sha256=ZB5WDmKfiDvs988kHZVyzF-RIoDLXcXuvdLjuEYvDi4,2181
266
267
  dissect/target/tools/shell.py,sha256=ozNcHaOWzgE3jdYzK8kL3E2vug1Y_S0iBfMQ9ubK9Y4,40444
267
- dissect/target/tools/utils.py,sha256=f9rOyLUfdddwy0sxoHJW9OmqJhJfMIP1_GBvVjm2UOw,9198
268
+ dissect/target/tools/utils.py,sha256=UDZoeXO_82YewSKasiw0zwtoyEdd0Koko-xSboCpkN4,9146
268
269
  dissect/target/tools/dump/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
269
270
  dissect/target/tools/dump/run.py,sha256=yHn9xl_VjasgiuLpjtZdnLW32QCbkwHfnnTPY6Ck_aw,9689
270
271
  dissect/target/tools/dump/state.py,sha256=ZBNz4ou2Xk20K1H8R83S1gq6qcqPvPPVAaPWzpKpX34,9123
@@ -274,10 +275,10 @@ dissect/target/volumes/bde.py,sha256=gYGg5yF9MNARwNzEkrEfZmKkxyZW4rhLkpdnPJCbhGk
274
275
  dissect/target/volumes/disk.py,sha256=95grSsPt1BLVpKwTclwQYzPFGKTkFFqapIk0RoGWf38,968
275
276
  dissect/target/volumes/lvm.py,sha256=_kIB1mdRs1OFhRgoT4VEP5Fv8imQnI7oQ_ie4x710tQ,1814
276
277
  dissect/target/volumes/vmfs.py,sha256=mlAJ8278tYaoRjk1u6tFFlCaDQUrVu5ZZE4ikiFvxi8,1707
277
- dissect.target-3.11.dev29.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
278
- dissect.target-3.11.dev29.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
279
- dissect.target-3.11.dev29.dist-info/METADATA,sha256=m03cyMq3P5ZrKwHrr1l0WZJq6i2ll8vyItJhC4cx3sk,10755
280
- dissect.target-3.11.dev29.dist-info/WHEEL,sha256=AtBG6SXL3KF_v0NxLf0ehyVOh0cold-JbJYXNGorC6Q,92
281
- dissect.target-3.11.dev29.dist-info/entry_points.txt,sha256=tvFPa-Ap-gakjaPwRc6Fl6mxHzxEZ_arAVU-IUYeo_s,447
282
- dissect.target-3.11.dev29.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
283
- dissect.target-3.11.dev29.dist-info/RECORD,,
278
+ dissect.target-3.11.dev31.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
279
+ dissect.target-3.11.dev31.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
280
+ dissect.target-3.11.dev31.dist-info/METADATA,sha256=ZWMfnWRLWUsYNG7urwZmvl4-lMLhySSmKz0eZqw4FlM,10755
281
+ dissect.target-3.11.dev31.dist-info/WHEEL,sha256=AtBG6SXL3KF_v0NxLf0ehyVOh0cold-JbJYXNGorC6Q,92
282
+ dissect.target-3.11.dev31.dist-info/entry_points.txt,sha256=tvFPa-Ap-gakjaPwRc6Fl6mxHzxEZ_arAVU-IUYeo_s,447
283
+ dissect.target-3.11.dev31.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
284
+ dissect.target-3.11.dev31.dist-info/RECORD,,