Skip to content

Commit 1d20e65

Browse files
committed
Add versioning to MFT extension classes
1 parent 8b30813 commit 1d20e65

File tree

2 files changed

+36
-3
lines changed

2 files changed

+36
-3
lines changed

volatility3/framework/plugins/windows/mftscan.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,21 @@ def get_requirements(cls):
4949
component=timeliner.TimeLinerInterface,
5050
version=(1, 0, 0),
5151
),
52+
requirements.VersionRequirement(
53+
name="mft_entry",
54+
component=mft.MFTEntry,
55+
version=(1, 0, 0),
56+
),
57+
requirements.VersionRequirement(
58+
name="mft_filename",
59+
component=mft.MFTFileName,
60+
version=(1, 0, 0),
61+
),
62+
requirements.VersionRequirement(
63+
name="mft_attribute",
64+
component=mft.MFTAttribute,
65+
version=(1, 0, 0),
66+
),
5267
requirements.VersionRequirement(
5368
name="yarascanner", component=yarascan.YaraScanner, version=(2, 1, 0)
5469
),

volatility3/framework/symbols/windows/extensions/mft.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,20 @@
55
import logging
66
from typing import Dict, Iterator, List, Optional, Tuple
77

8+
from volatility3 import framework
89
from volatility3.framework import constants, exceptions, interfaces, objects
910

1011
vollog = logging.getLogger(__name__)
1112

1213

13-
class MFTEntry(objects.StructType):
14+
class MFTEntry(objects.StructType, interfaces.configuration.VersionableInterface):
1415
"""This represents the base MFT Record"""
1516

17+
_version = (1, 0, 0)
18+
_required_framework_version = (2, 26, 0)
19+
20+
framework.require_interface_version(*_required_framework_version)
21+
1622
def __init__(
1723
self,
1824
context: interfaces.context.ContextInterface,
@@ -144,19 +150,31 @@ def alternate_data_streams(self) -> Iterator["MFTAttribute"]:
144150
yield attr
145151

146152

147-
class MFTFileName(objects.StructType):
153+
class MFTFileName(objects.StructType, interfaces.configuration.VersionableInterface):
148154
"""This represents an MFT $FILE_NAME Attribute"""
149155

156+
_version = (1, 0, 0)
157+
158+
_required_framework_version = (2, 26, 0)
159+
160+
framework.require_interface_version(*_required_framework_version)
161+
150162
def get_full_name(self) -> objects.String:
151163
output = self.Name.cast(
152164
"string", encoding="utf16", max_length=self.NameLength * 2, errors="replace"
153165
)
154166
return output
155167

156168

157-
class MFTAttribute(objects.StructType):
169+
class MFTAttribute(objects.StructType, interfaces.configuration.VersionableInterface):
158170
"""This represents an MFT ATTRIBUTE"""
159171

172+
_version = (1, 0, 0)
173+
174+
_required_framework_version = (2, 26, 0)
175+
176+
framework.require_interface_version(*_required_framework_version)
177+
160178
def get_resident_filename(self) -> Optional[objects.String]:
161179
# 4MB chosen as cutoff instead of 4KB to allow for recovery from format /L created file systems
162180
# Length as 512 as its 256*2, which is the maximum size for an entire file path, so this is even generous

0 commit comments

Comments
 (0)