dissect.ntfs 3.10.dev2__tar.gz → 3.10.dev4__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.
- {dissect.ntfs-3.10.dev2/dissect.ntfs.egg-info → dissect.ntfs-3.10.dev4}/PKG-INFO +1 -1
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/dissect/ntfs/mft.py +12 -4
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4/dissect.ntfs.egg-info}/PKG-INFO +1 -1
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/tests/test_mft.py +15 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/COPYRIGHT +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/LICENSE +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/MANIFEST.in +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/README.md +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/dissect/ntfs/__init__.py +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/dissect/ntfs/attr.py +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/dissect/ntfs/c_ntfs.py +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/dissect/ntfs/exceptions.py +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/dissect/ntfs/index.py +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/dissect/ntfs/ntfs.py +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/dissect/ntfs/secure.py +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/dissect/ntfs/stream.py +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/dissect/ntfs/usnjrnl.py +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/dissect/ntfs/util.py +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/dissect.ntfs.egg-info/SOURCES.txt +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/dissect.ntfs.egg-info/dependency_links.txt +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/dissect.ntfs.egg-info/requires.txt +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/dissect.ntfs.egg-info/top_level.txt +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/pyproject.toml +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/setup.cfg +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/tests/__init__.py +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/tests/conftest.py +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/tests/data/boot_2m.bin.gz +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/tests/data/mft.bin.gz +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/tests/data/ntfs.bin.gz +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/tests/data/ntfs_fragmented_mft.csv.gz +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/tests/data/sds.bin.gz +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/tests/data/sds_complex.bin.gz +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/tests/docs/Makefile +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/tests/docs/conf.py +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/tests/docs/index.rst +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/tests/test_attr.py +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/tests/test_index.py +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/tests/test_ntfs.py +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/tests/test_secure.py +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/tests/test_usnjrnl.py +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/tests/test_util.py +0 -0
- {dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dissect.ntfs
|
|
3
|
-
Version: 3.10.
|
|
3
|
+
Version: 3.10.dev4
|
|
4
4
|
Summary: A Dissect module implementing a parser for the NTFS file system, used by the Windows operating system
|
|
5
5
|
Author-email: Dissect Team <dissect@fox-it.com>
|
|
6
6
|
License: Affero General Public License v3
|
|
@@ -120,12 +120,20 @@ class Mft:
|
|
|
120
120
|
else:
|
|
121
121
|
raise TypeError(f"Invalid MFT reference: {ref!r}")
|
|
122
122
|
|
|
123
|
-
def segments(self) -> Iterator[MftRecord]:
|
|
124
|
-
"""Yield all valid MFT records, regardless if they're allocated or not.
|
|
123
|
+
def segments(self, start: int = 0, end: int = -1) -> Iterator[MftRecord]:
|
|
124
|
+
"""Yield all valid MFT records, regardless if they're allocated or not.
|
|
125
|
+
|
|
126
|
+
Args:
|
|
127
|
+
start: The starting segment number. Use ``-1`` to start from the last segment.
|
|
128
|
+
end: The ending segment number. Use ``-1`` to end with the last segment.
|
|
129
|
+
"""
|
|
125
130
|
record_size = self.ntfs._record_size if self.ntfs else DEFAULT_RECORD_SIZE
|
|
126
|
-
|
|
131
|
+
last_segment = self.get(FILE_NUMBER_MFT).size() // record_size
|
|
132
|
+
start = last_segment if start == -1 else start
|
|
133
|
+
end = last_segment if end == -1 else end
|
|
134
|
+
step = 1 if start <= end else -1
|
|
127
135
|
|
|
128
|
-
for segment in range(
|
|
136
|
+
for segment in range(start, end + step, step):
|
|
129
137
|
try:
|
|
130
138
|
yield self.get(segment)
|
|
131
139
|
except Error:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dissect.ntfs
|
|
3
|
-
Version: 3.10.
|
|
3
|
+
Version: 3.10.dev4
|
|
4
4
|
Summary: A Dissect module implementing a parser for the NTFS file system, used by the Windows operating system
|
|
5
5
|
Author-email: Dissect Team <dissect@fox-it.com>
|
|
6
6
|
License: Affero General Public License v3
|
|
@@ -79,3 +79,18 @@ def test_mft_record() -> None:
|
|
|
79
79
|
record = mft.get(0)
|
|
80
80
|
assert record.filename == "$MFT"
|
|
81
81
|
assert record.filenames() == ["$MFT"]
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def test_mft_records_segment_number(mft_bin: BinaryIO) -> None:
|
|
85
|
+
fs = NTFS(mft=mft_bin)
|
|
86
|
+
assert fs.mft
|
|
87
|
+
|
|
88
|
+
records_forward = list(fs.mft.segments(0, 4))
|
|
89
|
+
assert len(records_forward) == 5
|
|
90
|
+
assert records_forward[0].filename == "$MFT"
|
|
91
|
+
assert records_forward[4].filename == "$AttrDef"
|
|
92
|
+
|
|
93
|
+
records_backwards = list(fs.mft.segments(4, 0))
|
|
94
|
+
assert len(records_backwards) == 5
|
|
95
|
+
assert records_backwards[0].filename == "$AttrDef"
|
|
96
|
+
assert records_backwards[4].filename == "$MFT"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dissect.ntfs-3.10.dev2 → dissect.ntfs-3.10.dev4}/dissect.ntfs.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|