dissect.apfs 1.2.dev1__py3-none-any.whl → 1.2.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.
- dissect/apfs/stream.py +14 -10
- {dissect_apfs-1.2.dev1.dist-info → dissect_apfs-1.2.dev2.dist-info}/METADATA +1 -1
- {dissect_apfs-1.2.dev1.dist-info → dissect_apfs-1.2.dev2.dist-info}/RECORD +7 -7
- {dissect_apfs-1.2.dev1.dist-info → dissect_apfs-1.2.dev2.dist-info}/WHEEL +0 -0
- {dissect_apfs-1.2.dev1.dist-info → dissect_apfs-1.2.dev2.dist-info}/licenses/COPYRIGHT +0 -0
- {dissect_apfs-1.2.dev1.dist-info → dissect_apfs-1.2.dev2.dist-info}/licenses/LICENSE +0 -0
- {dissect_apfs-1.2.dev1.dist-info → dissect_apfs-1.2.dev2.dist-info}/top_level.txt +0 -0
dissect/apfs/stream.py
CHANGED
|
@@ -88,26 +88,30 @@ class FileStream(AlignedStream):
|
|
|
88
88
|
|
|
89
89
|
while length:
|
|
90
90
|
logical_address, physical_address, extent_length, crypto_id = self._lookup(offset)
|
|
91
|
-
|
|
91
|
+
|
|
92
|
+
offset_in_extent = offset - logical_address
|
|
93
|
+
if offset_in_extent >= extent_length:
|
|
94
|
+
raise Error(
|
|
95
|
+
f"Offset {offset:#x} is out of bounds for extent ({logical_address:#x}, {extent_length:#x})"
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
block_in_extent = offset_in_extent // self.align
|
|
99
|
+
read_length = min(extent_length - offset_in_extent, length)
|
|
100
|
+
block = self.volume.container._read_block(physical_address + block_in_extent, read_length // self.align)
|
|
92
101
|
|
|
93
102
|
if self.volume.is_encrypted:
|
|
94
103
|
if not self.volume._cipher:
|
|
95
104
|
raise Error("Volume is encrypted, unlock it first")
|
|
96
105
|
|
|
97
106
|
if self.volume.is_onekey:
|
|
98
|
-
|
|
107
|
+
sector = (crypto_id + block_in_extent) * self.volume.container.sectors_per_block
|
|
108
|
+
block = self.volume._cipher.decrypt(block, sector)
|
|
99
109
|
else:
|
|
100
110
|
raise Error("Multi-key encryption is not supported yet")
|
|
101
111
|
|
|
102
|
-
if offset_in_extent := offset - logical_address:
|
|
103
|
-
block = block[offset_in_extent:]
|
|
104
|
-
|
|
105
|
-
if length < len(block):
|
|
106
|
-
block = block[:length]
|
|
107
|
-
|
|
108
112
|
result.append(block)
|
|
109
|
-
offset +=
|
|
110
|
-
length -=
|
|
113
|
+
offset += read_length
|
|
114
|
+
length -= read_length
|
|
111
115
|
|
|
112
116
|
return b"".join(result)
|
|
113
117
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dissect.apfs
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.dev2
|
|
4
4
|
Summary: A Dissect module implementing a parser for the APFS file system, a commonly used Apple file system
|
|
5
5
|
Author-email: Dissect Team <dissect@fox-it.com>
|
|
6
6
|
License-Expression: AGPL-3.0-or-later
|
|
@@ -4,7 +4,7 @@ dissect/apfs/c_apfs.py,sha256=fN_6UFNeFMKmneplj5-5OxXXCRtX6n-bD09ehklV62w,52225
|
|
|
4
4
|
dissect/apfs/c_apfs.pyi,sha256=uC8exSo4ZPAG19UNDsBKaYe_Dzo1Vdmme4H2t1bfXd4,95421
|
|
5
5
|
dissect/apfs/cursor.py,sha256=wN02FxEipcxUjw7roLcTa_wKjuxXofwNUnvrBrD04ac,5747
|
|
6
6
|
dissect/apfs/exception.py,sha256=3Y0ZcM4ScZ3ajsUniWJUYQBay86dtz6-jt67uOzFUHI,300
|
|
7
|
-
dissect/apfs/stream.py,sha256=
|
|
7
|
+
dissect/apfs/stream.py,sha256=uR3QqZHy-owAoV0lARJ8e0W54DNXJAU0wRssrf_5gk8,7806
|
|
8
8
|
dissect/apfs/util.py,sha256=a36KbuLbc7594V5_Iu8yggSSYF4057YSHd1z5nO0_ko,4688
|
|
9
9
|
dissect/apfs/objects/__init__.py,sha256=d79CJGKxHrXOdLOhGp8cfvp_0A0Txi5KyFc6h9Fi7jw,1793
|
|
10
10
|
dissect/apfs/objects/base.py,sha256=gr-8PGSzP7nPN7CkAdb1x2thuFK2wu-5S-Di9uD6XOs,6316
|
|
@@ -30,9 +30,9 @@ dissect/apfs/objects/spaceman.py,sha256=LN8WHRA_QHhoQVdTid-5-CIXkYgcq3HOMwP5VaUE
|
|
|
30
30
|
dissect/apfs/objects/spaceman_bitmap.py,sha256=F4idJVAmw2_6ypjH-Ovd-U-_ycBDvRdcQGTNByDDU1w,242
|
|
31
31
|
dissect/apfs/objects/spaceman_cab.py,sha256=pf9tNPNoJTZ5Sae4n3UYci75XvYDJ-L0KrwfHDZ0qFQ,345
|
|
32
32
|
dissect/apfs/objects/spaceman_cib.py,sha256=xKoIPb-Y4brgTZzpTw2Rqf564b0dAZZalcDtO6-326Y,334
|
|
33
|
-
dissect_apfs-1.2.
|
|
34
|
-
dissect_apfs-1.2.
|
|
35
|
-
dissect_apfs-1.2.
|
|
36
|
-
dissect_apfs-1.2.
|
|
37
|
-
dissect_apfs-1.2.
|
|
38
|
-
dissect_apfs-1.2.
|
|
33
|
+
dissect_apfs-1.2.dev2.dist-info/licenses/COPYRIGHT,sha256=m2OYfg5NAsBXgWPGBn4p9g5-Fo0wViC65YkYsFNUaJk,299
|
|
34
|
+
dissect_apfs-1.2.dev2.dist-info/licenses/LICENSE,sha256=DZak_2itbUtvHzD3E7GNUYSRK6jdOJ-GqncQ2weavLA,34523
|
|
35
|
+
dissect_apfs-1.2.dev2.dist-info/METADATA,sha256=zyRIQCSsK-aAzJrHoc0EbjhTwzzxv3-TvQfWRQ3BTf4,3361
|
|
36
|
+
dissect_apfs-1.2.dev2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
37
|
+
dissect_apfs-1.2.dev2.dist-info/top_level.txt,sha256=Mn-CQzEYsAbkxrUI0TnplHuXnGVKzxpDw_po_sXpvv4,8
|
|
38
|
+
dissect_apfs-1.2.dev2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|