dissect.target 3.20.dev55__py3-none-any.whl → 3.20.dev57__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- from dissect.hypervisor import vma
1
+ from dissect.archive import vma
2
2
 
3
3
  from dissect.target.containers.raw import RawContainer
4
4
  from dissect.target.loader import Loader
@@ -1,4 +1,4 @@
1
- from dissect.hypervisor import xva
1
+ from dissect.archive import xva
2
2
 
3
3
  from dissect.target.containers.raw import RawContainer
4
4
  from dissect.target.loader import Loader
@@ -4,6 +4,7 @@ from typing import Iterator
4
4
 
5
5
  from defusedxml import ElementTree
6
6
  from dissect.util.ts import wintimestamp
7
+ from flow.record.base import is_valid_field_name
7
8
 
8
9
  from dissect.target.exceptions import UnsupportedPluginError
9
10
  from dissect.target.helpers.fsutil import Path
@@ -11,7 +12,9 @@ from dissect.target.helpers.record import DynamicDescriptor, TargetRecordDescrip
11
12
  from dissect.target.plugin import Plugin, export
12
13
  from dissect.target.target import Target
13
14
 
14
- camel_case_patterns = [re.compile(r"(\S)([A-Z][a-z]+)"), re.compile(r"([a-z0-9])([A-Z])"), re.compile(r"(\w)[.\s](\w)")]
15
+ CAMEL_CASE_PATTERNS = [re.compile(r"(\S)([A-Z][a-z]+)"), re.compile(r"([a-z0-9])([A-Z])"), re.compile(r"(\w)[.\s](\w)")]
16
+ RE_VALID_KEY_START_CHARS = re.compile(r"[a-zA-Z]")
17
+ RE_VALID_KEY_CHARS = re.compile(r"[a-zA-Z0-9_]")
15
18
 
16
19
 
17
20
  def _create_record_descriptor(record_name: str, record_fields: list[tuple[str, str]]) -> TargetRecordDescriptor:
@@ -49,13 +52,25 @@ class WindowsErrorReportingPlugin(Plugin):
49
52
 
50
53
  def _sanitize_key(self, key: str) -> str:
51
54
  # Convert camel case to snake case
52
- for pattern in camel_case_patterns:
55
+ for pattern in CAMEL_CASE_PATTERNS:
53
56
  key = pattern.sub(r"\1_\2", key)
54
57
 
55
- # Keep only basic characters in key
56
- key = re.sub(r"[^a-zA-Z0-9_]", "", key)
57
-
58
- return key.lower()
58
+ clean_key = ""
59
+ separator = "_"
60
+ prev_encoded = False
61
+ for idx, char in enumerate(key):
62
+ if prev_encoded:
63
+ clean_key += separator
64
+ clean_key += char
65
+ if not is_valid_field_name(clean_key):
66
+ clean_key = clean_key[:-1]
67
+ prefix = f"{separator}x" if (idx != 0 and not prev_encoded) else "x"
68
+ clean_key += prefix + char.encode("utf-8").hex()
69
+ prev_encoded = True
70
+ else:
71
+ prev_encoded = False
72
+
73
+ return clean_key.lower()
59
74
 
60
75
  def _collect_wer_data(self, wer_file: Path) -> tuple[list[tuple[str, str]], dict[str, str]]:
61
76
  """Parse data from a .wer file."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dissect.target
3
- Version: 3.20.dev55
3
+ Version: 3.20.dev57
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
@@ -38,6 +38,7 @@ Requires-Dist: dissect.target[full] ; extra == 'cb'
38
38
  Requires-Dist: carbon-black-cloud-sdk ~=1.4.3 ; extra == 'cb'
39
39
  Provides-Extra: dev
40
40
  Requires-Dist: dissect.target[full,mqtt,yara] ; extra == 'dev'
41
+ Requires-Dist: dissect.archive[dev] <2.0.dev,>=1.0.dev ; extra == 'dev'
41
42
  Requires-Dist: dissect.btrfs[dev] <2.0.dev,>=1.0.dev ; extra == 'dev'
42
43
  Requires-Dist: dissect.cim[dev] <4.0.dev,>=3.0.dev ; extra == 'dev'
43
44
  Requires-Dist: dissect.clfs[dev] <2.0.dev,>=1.0.dev ; extra == 'dev'
@@ -63,6 +64,7 @@ Requires-Dist: dissect.volume[dev] <4.0.dev,>=3.0.dev ; extra == 'dev'
63
64
  Requires-Dist: dissect.xfs[dev] <4.0.dev,>=3.0.dev ; extra == 'dev'
64
65
  Provides-Extra: full
65
66
  Requires-Dist: asn1crypto ; extra == 'full'
67
+ Requires-Dist: dissect.archive <2,>=1 ; extra == 'full'
66
68
  Requires-Dist: dissect.btrfs <2,>=1 ; extra == 'full'
67
69
  Requires-Dist: dissect.cim <4,>=3 ; extra == 'full'
68
70
  Requires-Dist: dissect.clfs <2,>=1 ; extra == 'full'
@@ -107,10 +107,10 @@ dissect/target/loaders/utm.py,sha256=7oHYP_jmr5gcjoyOP1pnh9Rz-IqQirBI6bjSvGwiKao
107
107
  dissect/target/loaders/vb.py,sha256=CdimOMeoJEDq8xYDgtldGSiwhR-dY5uxac1L0sYwAEU,2078
108
108
  dissect/target/loaders/vbox.py,sha256=8JD7D8iAY9JRvTHsrosp5ZMsZezuLhZ10Zt8sEL7KBI,732
109
109
  dissect/target/loaders/velociraptor.py,sha256=auMdtLguOxr2Bsx4R0vVr0pHpn2xCwgBy3Rx35k51C8,4932
110
- dissect/target/loaders/vma.py,sha256=AAY5-s-nz6wgvmcFkptJD7nNXhpkdf6SqEKVOrJaIKs,644
110
+ dissect/target/loaders/vma.py,sha256=tF3B4TdRWHJ8gklQliSRn1bMYx0uozTFkmn_QHS-Dqc,641
111
111
  dissect/target/loaders/vmwarevm.py,sha256=1MlKoIuWSwpYmpuLxDuVacvaYHUhAGO1KgZxzrc4fyg,428
112
112
  dissect/target/loaders/vmx.py,sha256=o1rYYKu6ReleqqHf2aeRcNrmoRcngWZNhz1h7GlmggQ,962
113
- dissect/target/loaders/xva.py,sha256=WmqdM9qGrZcChx0PiiTLyMTSatJIy_ItGO9cPMALQSE,709
113
+ dissect/target/loaders/xva.py,sha256=MFFhOS4d1DIaiHYRRvWKoJK-9-4kT9kY0IGsTNugzfY,706
114
114
  dissect/target/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
115
115
  dissect/target/plugins/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
116
116
  dissect/target/plugins/apps/av/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -300,7 +300,7 @@ dissect/target/plugins/os/windows/syscache.py,sha256=SXJxwyC34WPUpo0zGqbthdLPSPC
300
300
  dissect/target/plugins/os/windows/tasks.py,sha256=Bpy3tosncnFuGRqomEtB1jwJCVehZq4suhUznjtq4wo,5718
301
301
  dissect/target/plugins/os/windows/thumbcache.py,sha256=jAceapDdP9bNLGZchJ1l1okm7_7xiYHRbI2hVGAzMPk,4249
302
302
  dissect/target/plugins/os/windows/ual.py,sha256=S43ltndKKrs2SqeDLgZv4dzdqtJD8c3Y0Z8FK-Y9IOA,10076
303
- dissect/target/plugins/os/windows/wer.py,sha256=ogecvKYxAvDXLptQj4cn0JLn1FxaXjeSuJWs4JgkoZs,8656
303
+ dissect/target/plugins/os/windows/wer.py,sha256=y4ZU6Yai53UsZ4VLr0V9_uLhZJZ_UEtdPuNzxKbGoEY,9269
304
304
  dissect/target/plugins/os/windows/wua_history.py,sha256=QNtOQNZWKsKyUUrUV8aeoAMDKoH-ERkLx8ahnJzpHCY,54783
305
305
  dissect/target/plugins/os/windows/credential/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
306
306
  dissect/target/plugins/os/windows/credential/credhist.py,sha256=YSjuyd53Augdy_lKKzZHtx5Ozt0HzF6LDYIOb-8P1Pw,7058
@@ -378,10 +378,10 @@ dissect/target/volumes/luks.py,sha256=OmCMsw6rCUXG1_plnLVLTpsvE1n_6WtoRUGQbpmu1z
378
378
  dissect/target/volumes/lvm.py,sha256=wwQVR9I3G9YzmY6UxFsH2Y4MXGBcKL9aayWGCDTiWMU,2269
379
379
  dissect/target/volumes/md.py,sha256=7ShPtusuLGaIv27SvEETtgsuoQyAa4iAAeOR1NEaajI,1689
380
380
  dissect/target/volumes/vmfs.py,sha256=-LoUbn9WNwTtLi_4K34uV_-wDw2W5hgaqxZNj4UmqAQ,1730
381
- dissect.target-3.20.dev55.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
382
- dissect.target-3.20.dev55.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
383
- dissect.target-3.20.dev55.dist-info/METADATA,sha256=XXOoKVpCLQtujOefyVUrDiAmBGtT4xK0xWacC7hmISA,12897
384
- dissect.target-3.20.dev55.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
385
- dissect.target-3.20.dev55.dist-info/entry_points.txt,sha256=BWuxAb_6AvUAQpIQOQU0IMTlaF6TDht2AIZK8bHd-zE,492
386
- dissect.target-3.20.dev55.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
387
- dissect.target-3.20.dev55.dist-info/RECORD,,
381
+ dissect.target-3.20.dev57.dist-info/COPYRIGHT,sha256=m-9ih2RVhMiXHI2bf_oNSSgHgkeIvaYRVfKTwFbnJPA,301
382
+ dissect.target-3.20.dev57.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
383
+ dissect.target-3.20.dev57.dist-info/METADATA,sha256=6Sf6uGhjSx0idsxYz-GPwrPZBOFzZQ4f0oZsPlHjFhE,13025
384
+ dissect.target-3.20.dev57.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
385
+ dissect.target-3.20.dev57.dist-info/entry_points.txt,sha256=BWuxAb_6AvUAQpIQOQU0IMTlaF6TDht2AIZK8bHd-zE,492
386
+ dissect.target-3.20.dev57.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
387
+ dissect.target-3.20.dev57.dist-info/RECORD,,