dissect.target 3.20.dev33__py3-none-any.whl → 3.20.dev35__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -119,4 +119,9 @@ class JFFSFilesystemEntry(FilesystemEntry):
119
119
  ]
120
120
  )
121
121
 
122
+ # JFFS2 block size is a function of the "erase size" of the underlying flash device.
123
+ # Linux stat reports the default block size, which is defined as 4k in libc.
124
+ st_info.st_blksize = 4096
125
+ st_info.st_blocks = (node.isize + 511) // 512 if self.is_file() else 0
126
+
122
127
  return st_info
@@ -1,3 +1,4 @@
1
+ import logging
1
2
  from functools import partial
2
3
  from typing import Callable, Iterable, Iterator
3
4
 
@@ -95,13 +96,16 @@ def modify_record(target: Target, record: Record, modifier_function: ModifierFun
95
96
  try:
96
97
  _record = modifier_function(field_name, resolved_path)
97
98
  except FilesystemError as e:
98
- target.log.warning(
99
+ level = logging.INFO if isinstance(e, FileNotFoundError) else logging.WARNING
100
+ target.log.log(
101
+ level,
99
102
  "Unable to modify record '%s' with function '%s': %s",
100
103
  record._desc.name,
101
104
  modifier_function.__name__,
102
105
  e,
103
106
  )
104
107
  target.log.debug("", exc_info=e)
108
+
105
109
  else:
106
110
  additional_records.append(_record)
107
111
 
dissect/target/target.py CHANGED
@@ -19,6 +19,7 @@ from dissect.target.exceptions import (
19
19
  VolumeSystemError,
20
20
  )
21
21
  from dissect.target.helpers import config
22
+ from dissect.target.helpers.fsutil import TargetPath
22
23
  from dissect.target.helpers.loaderutil import extract_path_info
23
24
  from dissect.target.helpers.record import ChildTargetRecord
24
25
  from dissect.target.helpers.utils import StrEnum, parse_path_uri, slugify
@@ -86,8 +87,13 @@ class Target:
86
87
  self._errors = []
87
88
  self._applied = False
88
89
 
90
+ # We do not want to look for config files at the Target path if it is actually a child Target.
91
+ config_paths = [Path.cwd(), Path.home()]
92
+ if not isinstance(path, TargetPath):
93
+ config_paths = [self.path] + config_paths
94
+
89
95
  try:
90
- self._config = config.load([self.path, Path.cwd(), Path.home()])
96
+ self._config = config.load(config_paths)
91
97
  except Exception as e:
92
98
  self.log.warning("Error loading config file: %s", self.path)
93
99
  self.log.debug("", exc_info=e)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dissect.target
3
- Version: 3.20.dev33
3
+ Version: 3.20.dev35
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
@@ -5,7 +5,7 @@ dissect/target/filesystem.py,sha256=__p2p72B6mKgIiAOj85EC3ESdZ8gjgkm2pt1KKym3h0,
5
5
  dissect/target/loader.py,sha256=11B3W9IpfdTU9GJiKONGffuGeICog7J9ypXZ6mffsBE,7337
6
6
  dissect/target/plugin.py,sha256=xbvmjZMFNwJXZYMBE4KI93-nWL9Zhum8x39ydcO6s2o,50578
7
7
  dissect/target/report.py,sha256=06uiP4MbNI8cWMVrC1SasNS-Yg6ptjVjckwj8Yhe0Js,7958
8
- dissect/target/target.py,sha256=m4bAKgPLUJERKgxRZFevKvEBNaz77wIC5mVrDe6eI8o,32438
8
+ dissect/target/target.py,sha256=-UoFO_fqS6XPf77RDHSV4gNRi95wwwpgWq7zIhNVUGk,32719
9
9
  dissect/target/volume.py,sha256=aQZAJiny8jjwkc9UtwIRwy7nINXjCxwpO-_UDfh6-BA,15801
10
10
  dissect/target/containers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  dissect/target/containers/asdf.py,sha256=DJp0QEFwUjy2MFwKYcYqIR_BS1fQT1Yi9Kcmqt0aChM,1366
@@ -33,7 +33,7 @@ dissect/target/filesystems/extfs.py,sha256=6LkpCqhAfMzDmHklK9fecgmHto-ZnHQOpn7H8
33
33
  dissect/target/filesystems/fat.py,sha256=ZSw-wS57vo5eIXJndfI1rZkGu_qh-vyioMzCZFZ_UTE,4611
34
34
  dissect/target/filesystems/ffs.py,sha256=Wu8sS1jjmD0QXXcAaD2h_zzfvinjco8qvj0hErufZ-4,4555
35
35
  dissect/target/filesystems/itunes.py,sha256=w2lcWv6jlBPm84tsGZehxKBMXXyuW3KlmwVTF4ssQec,6395
36
- dissect/target/filesystems/jffs.py,sha256=Ceqa5Em2pepnXMH_XZFmSNjQyWPo1uWTthBFSMWfKRo,3926
36
+ dissect/target/filesystems/jffs.py,sha256=MZcoHf7h1rpXf0Mf8eMOjp3-tfUHZ9jQzkcaUdeQDyQ,4218
37
37
  dissect/target/filesystems/ntfs.py,sha256=Losf35q9aLm-YdwVllT5so99s-GqTF1ZXMbLX0PUNC0,7624
38
38
  dissect/target/filesystems/overlay.py,sha256=d0BNZcVd3SzBcM1SZO5nX2FrEYcdtVH34BPJQ6Oh4x8,4753
39
39
  dissect/target/filesystems/smb.py,sha256=uxfcOWwEoDCw8Qpsa94T5Pn-SKd4WXs4OOrzVVI55d8,6406
@@ -61,7 +61,7 @@ dissect/target/helpers/mui.py,sha256=i-7XoHbu4WO2fYapK9yGAMW04rFlgRispknc1KQIS5Q
61
61
  dissect/target/helpers/polypath.py,sha256=h8p7m_OCNiQljGwoZh5Aflr9H2ot6CZr6WKq1OSw58o,2175
62
62
  dissect/target/helpers/protobuf.py,sha256=b4DsnqrRLrefcDjx7rQno-_LBcwtJXxuKf5RdOegzfE,1537
63
63
  dissect/target/helpers/record.py,sha256=7Se6ZV8cvwEaGSjRd9bKhVnUAn4W4KR2eqP6AbQhTH4,5892
64
- dissect/target/helpers/record_modifier.py,sha256=O_Jj7zOi891HIyAYjxxe6LFPYETHdMa5lNjo4NA_T_w,3969
64
+ dissect/target/helpers/record_modifier.py,sha256=cRNDhUYMmx4iEKyEr5Pqy9xiFgxr_GBNJPp_omkQsEU,4094
65
65
  dissect/target/helpers/regutil.py,sha256=ti-ht2N9UxbMjhUBP2bybY76_dAvbCz0txPBszvSKVw,28171
66
66
  dissect/target/helpers/shell_application_ids.py,sha256=hYxrP-YtHK7ZM0ectJFHfoMB8QUXLbYNKmKXMWLZRlA,38132
67
67
  dissect/target/helpers/shell_folder_ids.py,sha256=Behhb8oh0kMxrEk6YYKYigCDZe8Hw5QS6iK_d2hTs2Y,24978
@@ -370,10 +370,10 @@ dissect/target/volumes/luks.py,sha256=OmCMsw6rCUXG1_plnLVLTpsvE1n_6WtoRUGQbpmu1z
370
370
  dissect/target/volumes/lvm.py,sha256=wwQVR9I3G9YzmY6UxFsH2Y4MXGBcKL9aayWGCDTiWMU,2269
371
371
  dissect/target/volumes/md.py,sha256=7ShPtusuLGaIv27SvEETtgsuoQyAa4iAAeOR1NEaajI,1689
372
372
  dissect/target/volumes/vmfs.py,sha256=-LoUbn9WNwTtLi_4K34uV_-wDw2W5hgaqxZNj4UmqAQ,1730
373
- dissect.target-3.20.dev33.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
374
- dissect.target-3.20.dev33.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
375
- dissect.target-3.20.dev33.dist-info/METADATA,sha256=uD4GaxEUoWZL5H_-CPfby5_dO5AtF9FcMXqIAESZIUI,12897
376
- dissect.target-3.20.dev33.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
377
- dissect.target-3.20.dev33.dist-info/entry_points.txt,sha256=BWuxAb_6AvUAQpIQOQU0IMTlaF6TDht2AIZK8bHd-zE,492
378
- dissect.target-3.20.dev33.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
379
- dissect.target-3.20.dev33.dist-info/RECORD,,
373
+ dissect.target-3.20.dev35.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
374
+ dissect.target-3.20.dev35.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
375
+ dissect.target-3.20.dev35.dist-info/METADATA,sha256=9GgIs5LXTcTHRD-MAebYgSiiOIqYLXAbKkDI6MrSJsg,12897
376
+ dissect.target-3.20.dev35.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
377
+ dissect.target-3.20.dev35.dist-info/entry_points.txt,sha256=BWuxAb_6AvUAQpIQOQU0IMTlaF6TDht2AIZK8bHd-zE,492
378
+ dissect.target-3.20.dev35.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
379
+ dissect.target-3.20.dev35.dist-info/RECORD,,