dissect.hypervisor 3.20.dev2__py3-none-any.whl → 3.21.dev2__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.
@@ -3,9 +3,9 @@
3
3
  # - https://github.com/qemu/qemu/blob/master/docs/interop/qcow2.txt
4
4
  from __future__ import annotations
5
5
 
6
+ import sys
6
7
  import zlib
7
8
  from functools import cached_property, lru_cache
8
- from io import BytesIO
9
9
  from pathlib import Path
10
10
  from typing import TYPE_CHECKING, BinaryIO
11
11
 
@@ -28,8 +28,10 @@ if TYPE_CHECKING:
28
28
  from collections.abc import Iterator
29
29
 
30
30
  try:
31
- import zstandard as zstd
32
-
31
+ if sys.version_info >= (3, 14):
32
+ from compression import zstd # novermin
33
+ else:
34
+ from backports import zstd
33
35
  HAS_ZSTD = True
34
36
  except ImportError:
35
37
  HAS_ZSTD = False
@@ -384,16 +386,8 @@ class QCow2Stream(AlignedStream):
384
386
  return dctx.decompress(buf, self.qcow2.cluster_size)
385
387
 
386
388
  if self.qcow2.compression_type == c_qcow2.QCOW2_COMPRESSION_TYPE_ZSTD:
387
- result = []
388
-
389
389
  dctx = zstd.ZstdDecompressor()
390
- reader = dctx.stream_reader(BytesIO(buf))
391
- while reader.tell() < self.qcow2.cluster_size:
392
- chunk = reader.read(self.qcow2.cluster_size - reader.tell())
393
- if not chunk:
394
- break
395
- result.append(chunk)
396
- return b"".join(result)
390
+ return dctx.decompress(buf, self.qcow2.cluster_size)
397
391
 
398
392
  raise Error(f"Invalid compression type: {self.qcow2.compression_type}")
399
393
 
@@ -407,7 +407,7 @@ RE_EXTENT_DESCRIPTOR = re.compile(
407
407
  ^
408
408
  (?P<access_mode>RW|RDONLY|NOACCESS)\s
409
409
  (?P<sectors>\d+)\s
410
- (?P<type>SPARSE|ZERO|FLAT|VMFS|VMFSSPARSE|VMFSRDM|VMFSRAW)
410
+ (?P<type>SESPARSE|SPARSE|ZERO|FLAT|VMFS|VMFSSPARSE|VMFSRDM|VMFSRAW)
411
411
  (\s(?P<filename>\".+\"))?
412
412
  (\s(?P<start_sector>\d+))?
413
413
  (\s(?P<partition_uuid>\S+))?
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dissect.hypervisor
3
- Version: 3.20.dev2
3
+ Version: 3.21.dev2
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-Expression: AGPL-3.0-or-later
@@ -26,6 +26,7 @@ Requires-Dist: dissect.cstruct<5,>=4
26
26
  Requires-Dist: dissect.util<4,>=3
27
27
  Provides-Extra: full
28
28
  Requires-Dist: pycryptodome; extra == "full"
29
+ Requires-Dist: backports.zstd; python_version < "3.14" and extra == "full"
29
30
  Provides-Extra: dev
30
31
  Requires-Dist: dissect.hypervisor[full]; extra == "dev"
31
32
  Requires-Dist: dissect.cstruct<5.0.dev,>=4.0.dev; extra == "dev"
@@ -19,21 +19,21 @@ dissect/hypervisor/disk/c_vhd.py,sha256=gYOwOdvhMKNLflugkpjmdn__ZUJBlxeByx6P0ePN
19
19
  dissect/hypervisor/disk/c_vhdx.py,sha256=4yNU51jfYPEBFXEZAvaF8cFdHBRlmCe_OU5ZU83-kco,2920
20
20
  dissect/hypervisor/disk/c_vmdk.py,sha256=lfObMyD9r-20DCDwVDm9xT98cq3aE4MCJF5TpDBNdd4,5988
21
21
  dissect/hypervisor/disk/hdd.py,sha256=ChKtQIQrssIgZyUv86JE9-n4XdjDT14pc6EO6mZllQg,12981
22
- dissect/hypervisor/disk/qcow2.py,sha256=j7GSgzYceSq6Nx7vw4M7Cm5irKqGDql1t9apl2gC1FY,24509
22
+ dissect/hypervisor/disk/qcow2.py,sha256=cQbmvOr76SWZmMNuFAWaecvGObZ2BsaVzUBB4ncfjNg,24318
23
23
  dissect/hypervisor/disk/vdi.py,sha256=Ezm_vmi6ZKLTgPx5chXmtBzkBOCxilBWUrdqQdq_4KA,1958
24
24
  dissect/hypervisor/disk/vhd.py,sha256=GfEfFp5g8OlV0MrTXqSfBRzMMvIZO_T1A8d05SeGiBk,3948
25
25
  dissect/hypervisor/disk/vhdx.py,sha256=kgxS81oG4J3RPsDput-t3QhbF1vDCdjfPqY__sWbX6g,13215
26
- dissect/hypervisor/disk/vmdk.py,sha256=s23a8Gs_kemy4ZKYuJYXYCFckZtYgeZ7Rmrgxpj5W7s,19565
26
+ dissect/hypervisor/disk/vmdk.py,sha256=AdiZ4ePSaOF6k99TiFpHu1MMXPuOc2edNKwr-FwER-o,19574
27
27
  dissect/hypervisor/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
28
  dissect/hypervisor/tools/envelope.py,sha256=BvaBSoXq3VrZ2GJVrfnL8NB6OLbdp8qD05jedxSAKwQ,1024
29
29
  dissect/hypervisor/tools/vmtar.py,sha256=bAf_rEhqUmeI8my22p7L9uV3SgB5C_61YQKfD3tNo60,476
30
30
  dissect/hypervisor/util/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
31
  dissect/hypervisor/util/envelope.py,sha256=EhZjZh3EezqxkJ84OgqpptHIhpVWPcUkFMjdYU-iAnU,10442
32
32
  dissect/hypervisor/util/vmtar.py,sha256=pktC1mZIhh1E2uSyb2Z_pvn9H9LebJ6hTmZlYcdGrOA,4038
33
- dissect_hypervisor-3.20.dev2.dist-info/licenses/COPYRIGHT,sha256=EOOoIwk_inOMUD4c1ylpzMtYLjGzmc-MLEVAEdLLr20,305
34
- dissect_hypervisor-3.20.dev2.dist-info/licenses/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
35
- dissect_hypervisor-3.20.dev2.dist-info/METADATA,sha256=_szrTasO-dTqofQuXnvKqetve_02e4UXod-3ZDdXU6A,3395
36
- dissect_hypervisor-3.20.dev2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
- dissect_hypervisor-3.20.dev2.dist-info/entry_points.txt,sha256=kW36GnJ3G1dSRYFL4r8Bj32Al_CkGqST3bdHvo3pyiY,120
38
- dissect_hypervisor-3.20.dev2.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
39
- dissect_hypervisor-3.20.dev2.dist-info/RECORD,,
33
+ dissect_hypervisor-3.21.dev2.dist-info/licenses/COPYRIGHT,sha256=EOOoIwk_inOMUD4c1ylpzMtYLjGzmc-MLEVAEdLLr20,305
34
+ dissect_hypervisor-3.21.dev2.dist-info/licenses/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
35
+ dissect_hypervisor-3.21.dev2.dist-info/METADATA,sha256=SQL6nIw8ModKMOBmA5voEp5kwhBkAle4xX3C_2A3xSw,3470
36
+ dissect_hypervisor-3.21.dev2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
37
+ dissect_hypervisor-3.21.dev2.dist-info/entry_points.txt,sha256=kW36GnJ3G1dSRYFL4r8Bj32Al_CkGqST3bdHvo3pyiY,120
38
+ dissect_hypervisor-3.21.dev2.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
39
+ dissect_hypervisor-3.21.dev2.dist-info/RECORD,,