dissect.hypervisor 3.14.dev3__tar.gz → 3.15__tar.gz

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.
Files changed (92) hide show
  1. {dissect_hypervisor-3.14.dev3/dissect.hypervisor.egg-info → dissect_hypervisor-3.15}/PKG-INFO +1 -1
  2. dissect_hypervisor-3.15/dissect/hypervisor/descriptor/vbox.py +17 -0
  3. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/util/envelope.py +4 -2
  4. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15/dissect.hypervisor.egg-info}/PKG-INFO +1 -1
  5. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/pyproject.toml +0 -1
  6. dissect_hypervisor-3.15/tests/test_vbox.py +41 -0
  7. dissect_hypervisor-3.14.dev3/dissect/hypervisor/descriptor/vbox.py +0 -17
  8. dissect_hypervisor-3.14.dev3/tests/test_vbox.py +0 -22
  9. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/COPYRIGHT +0 -0
  10. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/LICENSE +0 -0
  11. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/MANIFEST.in +0 -0
  12. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/README.md +0 -0
  13. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/__init__.py +0 -0
  14. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/backup/__init__.py +0 -0
  15. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/backup/c_vma.py +0 -0
  16. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/backup/vma.py +0 -0
  17. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/backup/xva.py +0 -0
  18. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/descriptor/__init__.py +0 -0
  19. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/descriptor/c_hyperv.py +0 -0
  20. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/descriptor/hyperv.py +0 -0
  21. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/descriptor/ovf.py +0 -0
  22. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/descriptor/pvs.py +0 -0
  23. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/descriptor/vmx.py +0 -0
  24. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/disk/__init__.py +0 -0
  25. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/disk/c_hdd.py +0 -0
  26. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/disk/c_qcow2.py +0 -0
  27. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/disk/c_vdi.py +0 -0
  28. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/disk/c_vhd.py +0 -0
  29. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/disk/c_vhdx.py +0 -0
  30. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/disk/c_vmdk.py +0 -0
  31. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/disk/hdd.py +0 -0
  32. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/disk/qcow2.py +0 -0
  33. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/disk/vdi.py +0 -0
  34. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/disk/vhd.py +0 -0
  35. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/disk/vhdx.py +0 -0
  36. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/disk/vmdk.py +0 -0
  37. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/exceptions.py +0 -0
  38. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/tools/__init__.py +0 -0
  39. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/tools/envelope.py +0 -0
  40. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/tools/vma.py +0 -0
  41. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/util/__init__.py +0 -0
  42. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect/hypervisor/util/vmtar.py +0 -0
  43. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect.hypervisor.egg-info/SOURCES.txt +0 -0
  44. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect.hypervisor.egg-info/dependency_links.txt +0 -0
  45. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect.hypervisor.egg-info/entry_points.txt +0 -0
  46. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect.hypervisor.egg-info/requires.txt +0 -0
  47. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/dissect.hypervisor.egg-info/top_level.txt +0 -0
  48. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/setup.cfg +0 -0
  49. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/__init__.py +0 -0
  50. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/conftest.py +0 -0
  51. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/differencing.avhdx.gz +0 -0
  52. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/dynamic.vhd.gz +0 -0
  53. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/dynamic.vhdx.gz +0 -0
  54. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/encrypted.vmx +0 -0
  55. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/encryption.info +0 -0
  56. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/expanding.hdd/DiskDescriptor.xml +0 -0
  57. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/expanding.hdd/expanding.hdd +0 -0
  58. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/expanding.hdd/expanding.hdd.0.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  59. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/fixed.vhd.gz +0 -0
  60. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/fixed.vhdx.gz +0 -0
  61. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/local.tgz.ve +0 -0
  62. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/plain.hdd/DiskDescriptor.xml +0 -0
  63. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/plain.hdd/plain.hdd +0 -0
  64. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/plain.hdd/plain.hdd.0.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  65. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/sesparse.vmdk.gz +0 -0
  66. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/split.hdd/DiskDescriptor.xml +0 -0
  67. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/split.hdd/split.hdd +0 -0
  68. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/split.hdd/split.hdd.0.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  69. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/split.hdd/split.hdd.1.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  70. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/split.hdd/split.hdd.2.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  71. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/split.hdd/split.hdd.3.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  72. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/split.hdd/split.hdd.4.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  73. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/split.hdd/split.hdd.5.{5fbaabe3-6958-40ff-92a7-860e329aab41}.hds.gz +0 -0
  74. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/test.VMRS +0 -0
  75. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/test.vgz +0 -0
  76. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/test.vma.gz +0 -0
  77. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/data/test.vmcx +0 -0
  78. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/docs/Makefile +0 -0
  79. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/docs/conf.py +0 -0
  80. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/docs/index.rst +0 -0
  81. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/test_envelope.py +0 -0
  82. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/test_hdd.py +0 -0
  83. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/test_hyperv.py +0 -0
  84. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/test_ovf.py +0 -0
  85. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/test_pvs.py +0 -0
  86. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/test_vhd.py +0 -0
  87. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/test_vhdx.py +0 -0
  88. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/test_vma.py +0 -0
  89. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/test_vmdk.py +0 -0
  90. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/test_vmtar.py +0 -0
  91. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tests/test_vmx.py +0 -0
  92. {dissect_hypervisor-3.14.dev3 → dissect_hypervisor-3.15}/tox.ini +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dissect.hypervisor
3
- Version: 3.14.dev3
3
+ Version: 3.15
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
@@ -0,0 +1,17 @@
1
+ from typing import IO, Iterator
2
+ from xml.etree.ElementTree import Element
3
+
4
+ from defusedxml import ElementTree
5
+
6
+
7
+ class VBox:
8
+ VBOX_XML_NAMESPACE = "{http://www.virtualbox.org/}"
9
+
10
+ def __init__(self, fh: IO):
11
+ self._xml: Element = ElementTree.fromstring(fh.read())
12
+
13
+ def disks(self) -> Iterator[str]:
14
+ for hdd_elem in self._xml.findall(f".//{self.VBOX_XML_NAMESPACE}HardDisk[@location][@type='Normal']"):
15
+ # Allow format specifier to be case-insensitive (i.e. VDI, vdi)
16
+ if (format := hdd_elem.get("format")) and format.lower() == "vdi":
17
+ yield hdd_elem.attrib["location"]
@@ -103,8 +103,9 @@ EnvelopeAttribute = namedtuple("EnvelopeAttribute", ("type", "flag", "value"))
103
103
  class Envelope:
104
104
  """Implements an encryption envelope as used within ESXi."""
105
105
 
106
- def __init__(self, fh: BinaryIO):
106
+ def __init__(self, fh: BinaryIO, verify: bool = True):
107
107
  self.fh = fh
108
+ self.verify = verify
108
109
 
109
110
  header_buf = io.BytesIO(self.fh.read(ENVELOPE_BLOCK_SIZE))
110
111
  self.header = c_envelope.EnvelopeFileHeader(header_buf)
@@ -190,7 +191,8 @@ class Envelope:
190
191
  footer = c_envelope.DataTransformCryptoFooter(bytes(decrypted[-512:]))
191
192
  decrypted = decrypted[: -4096 - footer.padding]
192
193
 
193
- cipher.verify(self.digest)
194
+ if self.verify:
195
+ cipher.verify(self.digest)
194
196
 
195
197
  return bytes(decrypted)
196
198
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dissect.hypervisor
3
- Version: 3.14.dev3
3
+ Version: 3.15
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
@@ -66,4 +66,3 @@ license-files = ["LICENSE", "COPYRIGHT"]
66
66
  include = ["dissect.*"]
67
67
 
68
68
  [tool.setuptools_scm]
69
- local_scheme = "no-local-version"
@@ -0,0 +1,41 @@
1
+ from io import StringIO
2
+
3
+ from dissect.hypervisor.descriptor.vbox import VBox
4
+
5
+
6
+ def test_vbox() -> None:
7
+ xml = """
8
+ <?xml version="1.0"?>
9
+ <VirtualBox xmlns="http://www.virtualbox.org/">
10
+ <Machine>
11
+ <MediaRegistry>
12
+ <HardDisks>
13
+ <HardDisk location="os2warp4.vdi" format="VDI" type="Normal" />
14
+ </HardDisks>
15
+ </MediaRegistry>
16
+ </Machine>
17
+ </VirtualBox>
18
+ """
19
+
20
+ with StringIO(xml.strip()) as fh:
21
+ vbox = VBox(fh)
22
+ assert next(vbox.disks()) == "os2warp4.vdi"
23
+
24
+
25
+ def test_vbox_lowercase_disk_format() -> None:
26
+ xml = """
27
+ <?xml version="1.0"?>
28
+ <VirtualBox xmlns="http://www.virtualbox.org/">
29
+ <Machine>
30
+ <MediaRegistry>
31
+ <HardDisks>
32
+ <HardDisk location="WinDev2407Eval-disk001.vdi" format="vdi" type="Normal" />
33
+ </HardDisks>
34
+ </MediaRegistry>
35
+ </Machine>
36
+ </VirtualBox>
37
+ """
38
+
39
+ with StringIO(xml.strip()) as fh:
40
+ vbox = VBox(fh)
41
+ assert next(vbox.disks()) == "WinDev2407Eval-disk001.vdi"
@@ -1,17 +0,0 @@
1
- from typing import IO, Iterator
2
- from xml.etree.ElementTree import Element
3
-
4
- from defusedxml import ElementTree
5
-
6
-
7
- class VBox:
8
- VBOX_XML_NAMESPACE = "{http://www.virtualbox.org/}"
9
-
10
- def __init__(self, fh: IO):
11
- self._xml: Element = ElementTree.fromstring(fh.read())
12
-
13
- def disks(self) -> Iterator[str]:
14
- for hdd_elem in self._xml.findall(
15
- f".//{self.VBOX_XML_NAMESPACE}HardDisk[@location][@format='VDI'][@type='Normal']"
16
- ):
17
- yield hdd_elem.attrib["location"]
@@ -1,22 +0,0 @@
1
- from io import StringIO
2
-
3
- from dissect.hypervisor.descriptor.vbox import VBox
4
-
5
-
6
- def test_vbox():
7
- xml = """
8
- <?xml version="1.0"?>
9
- <VirtualBox xmlns="http://www.virtualbox.org/">
10
- <Machine>
11
- <MediaRegistry>
12
- <HardDisks>
13
- <HardDisk location="os2warp4.vdi" format="VDI" type="Normal" />
14
- </HardDisks>
15
- </MediaRegistry>
16
- </Machine>
17
- </VirtualBox>
18
- """
19
-
20
- with StringIO(xml.strip()) as fh:
21
- vbox = VBox(fh)
22
- assert next(vbox.disks()) == "os2warp4.vdi"