dissect.hypervisor 3.16.dev2__py3-none-any.whl → 3.17.dev1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,7 @@ import ctypes
4
4
  import io
5
5
  import logging
6
6
  import os
7
+ import re
7
8
  import textwrap
8
9
  import zlib
9
10
  from bisect import bisect_right
@@ -401,8 +402,25 @@ class SparseExtentHeader:
401
402
  return getattr(self.hdr, attr)
402
403
 
403
404
 
405
+ RE_EXTENT_DESCRIPTOR = re.compile(
406
+ r"""
407
+ ^
408
+ (?P<access_mode>RW|RDONLY|NOACCESS)\s
409
+ (?P<sectors>\d+)\s
410
+ (?P<type>SPARSE|ZERO|FLAT|VMFS|VMFSSPARSE|VMFSRDM|VMFSRAW)
411
+ (\s(?P<filename>\".+\"))?
412
+ (\s(?P<start_sector>\d+))?
413
+ (\s(?P<partition_uuid>\S+))?
414
+ (\s(?P<device_identifier>\S+))?
415
+ $
416
+ """,
417
+ re.VERBOSE,
418
+ )
419
+
420
+
404
421
  @dataclass
405
422
  class ExtentDescriptor:
423
+ raw: str
406
424
  access_mode: str
407
425
  sectors: int
408
426
  type: str
@@ -412,7 +430,6 @@ class ExtentDescriptor:
412
430
  device_identifier: str | None = None
413
431
 
414
432
  def __post_init__(self) -> None:
415
- self._raw = " ".join(map(str, [v for v in self.__dict__.values() if v is not None]))
416
433
  self.sectors = int(self.sectors)
417
434
 
418
435
  if self.filename:
@@ -422,10 +439,10 @@ class ExtentDescriptor:
422
439
  self.start_sector = int(self.start_sector)
423
440
 
424
441
  def __repr__(self) -> str:
425
- return f"<ExtentDescriptor {self._raw}>"
442
+ return f"<ExtentDescriptor {self.raw}>"
426
443
 
427
444
  def __str__(self) -> str:
428
- return self._raw
445
+ return self.raw
429
446
 
430
447
 
431
448
  class DiskDescriptor:
@@ -458,14 +475,13 @@ class DiskDescriptor:
458
475
  continue
459
476
 
460
477
  if line.startswith("RW ") or line.startswith("RDONLY ") or line.startswith("NOACCESS "):
461
- # Extent descriptors can have up to seven values according to libvmdk documentation.
462
- parts = line.split(" ", maxsplit=6)
478
+ match = RE_EXTENT_DESCRIPTOR.search(line)
463
479
 
464
- if len(parts) < 3:
480
+ if not match:
465
481
  log.warning("Unexpected ExtentDescriptor format in vmdk config: %s, ignoring", line)
466
482
  continue
467
483
 
468
- extent = ExtentDescriptor(*parts)
484
+ extent = ExtentDescriptor(raw=line, **match.groupdict())
469
485
  sectors += extent.sectors
470
486
  extents.append(extent)
471
487
  continue
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dissect.hypervisor
3
- Version: 3.16.dev2
3
+ Version: 3.17.dev1
4
4
  Summary: A Dissect module implementing parsers for various hypervisor disk, backup and configuration files
5
5
  Author-email: Dissect Team <dissect@fox-it.com>
6
6
  License: Affero General Public License v3
@@ -23,14 +23,14 @@ Description-Content-Type: text/markdown
23
23
  License-File: LICENSE
24
24
  License-File: COPYRIGHT
25
25
  Requires-Dist: defusedxml
26
- Requires-Dist: dissect.cstruct <5,>=4
27
- Requires-Dist: dissect.util <4,>=3
28
- Provides-Extra: dev
29
- Requires-Dist: dissect.hypervisor[full] ; extra == 'dev'
30
- Requires-Dist: dissect.cstruct <5.0.dev,>=4.0.dev ; extra == 'dev'
31
- Requires-Dist: dissect.util <4.0.dev,>=3.0.dev ; extra == 'dev'
26
+ Requires-Dist: dissect.cstruct<5,>=4
27
+ Requires-Dist: dissect.util<4,>=3
32
28
  Provides-Extra: full
33
- Requires-Dist: pycryptodome ; extra == 'full'
29
+ Requires-Dist: pycryptodome; extra == "full"
30
+ Provides-Extra: dev
31
+ Requires-Dist: dissect.hypervisor[full]; extra == "dev"
32
+ Requires-Dist: dissect.cstruct<5.0.dev,>=4.0.dev; extra == "dev"
33
+ Requires-Dist: dissect.util<4.0.dev,>=3.0.dev; extra == "dev"
34
34
 
35
35
  # dissect.hypervisor
36
36
 
@@ -19,16 +19,16 @@ dissect/hypervisor/disk/qcow2.py,sha256=K4zstjte7SxX2psSbAj4YqwGeplfIvfbq5ScP4mz
19
19
  dissect/hypervisor/disk/vdi.py,sha256=_kX7ZGOVo_98ckMaiaDEmw4VjNgM57cY4YUSYrk2JGs,1851
20
20
  dissect/hypervisor/disk/vhd.py,sha256=OqSdEO2NGMI5DjgxWFbtZp8bPjSon7moMJn_5152MbI,3660
21
21
  dissect/hypervisor/disk/vhdx.py,sha256=FVGTY5mUKFb7oRNKNiLGd5ngGfaGvERtFCGhAlyZD_k,12631
22
- dissect/hypervisor/disk/vmdk.py,sha256=nXDWHziwbN1dxD-ehasuFG98mmhrf1Y9rNil0nAcUtI,19104
22
+ dissect/hypervisor/disk/vmdk.py,sha256=CNA2zCWZYKl6G3jWF23_ToJCqHkPR_GngtAH5rGWY30,19298
23
23
  dissect/hypervisor/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
24
  dissect/hypervisor/tools/envelope.py,sha256=6_RLtKmFnZ69fx8HlvFgsjDjNrfnXD73dgszpG1mYQE,967
25
25
  dissect/hypervisor/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
26
  dissect/hypervisor/util/envelope.py,sha256=6nEJfgsxj696qxaLOQ2k5MrVWA2uLkbB5zxxRAvboF4,10405
27
27
  dissect/hypervisor/util/vmtar.py,sha256=oNJ-qTvQVOl7al_vExpg_T4LnGyE72O9hjOmQBiTKSA,1469
28
- dissect.hypervisor-3.16.dev2.dist-info/COPYRIGHT,sha256=EOOoIwk_inOMUD4c1ylpzMtYLjGzmc-MLEVAEdLLr20,305
29
- dissect.hypervisor-3.16.dev2.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
30
- dissect.hypervisor-3.16.dev2.dist-info/METADATA,sha256=GXm75ZMxlXG4RfswMFCG2Mgflmpt0TMIfOdrxrIf7wA,3420
31
- dissect.hypervisor-3.16.dev2.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
32
- dissect.hypervisor-3.16.dev2.dist-info/entry_points.txt,sha256=oM21bFD0YBHKjgCBk-DQ2398PUZdKV2VNR_IWzd1yog,76
33
- dissect.hypervisor-3.16.dev2.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
34
- dissect.hypervisor-3.16.dev2.dist-info/RECORD,,
28
+ dissect.hypervisor-3.17.dev1.dist-info/COPYRIGHT,sha256=EOOoIwk_inOMUD4c1ylpzMtYLjGzmc-MLEVAEdLLr20,305
29
+ dissect.hypervisor-3.17.dev1.dist-info/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
30
+ dissect.hypervisor-3.17.dev1.dist-info/METADATA,sha256=eNMw0l3Ej2zgY_n-4RvjtpkMdopxd598cH04W6KvlTw,3412
31
+ dissect.hypervisor-3.17.dev1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
32
+ dissect.hypervisor-3.17.dev1.dist-info/entry_points.txt,sha256=oM21bFD0YBHKjgCBk-DQ2398PUZdKV2VNR_IWzd1yog,76
33
+ dissect.hypervisor-3.17.dev1.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
34
+ dissect.hypervisor-3.17.dev1.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.3.0)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5