Skip to content

Commit 9c05893

Browse files
committed
Address feedback
1 parent 660e8a7 commit 9c05893

File tree

1 file changed

+7
-5
lines changed
  • volatility3/framework/symbols/windows/extensions

1 file changed

+7
-5
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# which is available at https://www.volatilityfoundation.org/license/vsl-v1.0
33
#
44

5+
from typing import Optional
6+
57
from volatility3.framework import objects, constants, exceptions
68

79

@@ -26,11 +28,11 @@ def get_full_name(self) -> str:
2628
class MFTAttribute(objects.StructType):
2729
"""This represents an MFT ATTRIBUTE"""
2830

29-
def get_resident_filename(self) -> str:
31+
def get_resident_filename(self) -> Optional[str]:
3032
# 4MB chosen as cutoff instead of 4KB to allow for recovery from format /L created file systems
3133
# Length as 512 as its 256*2, which is the maximum size for an entire file path, so this is even generous
3234
if (
33-
self.Attr_Header.ContentOffset > 4194304
35+
self.Attr_Header.ContentOffset > 0x400000
3436
or self.Attr_Header.NameLength > 512
3537
):
3638
return None
@@ -49,12 +51,12 @@ def get_resident_filename(self) -> str:
4951
except exceptions.InvalidAddressException:
5052
return None
5153

52-
def get_resident_filecontent(self) -> bytes:
54+
def get_resident_filecontent(self) -> Optional[bytes]:
5355
# smear observed in mass testing of samples
5456
# 4MB chosen as cutoff instead of 4KB to allow for recovery from format /L created file systems
5557
if (
56-
self.Attr_Header.ContentOffset > 4194304
57-
or self.Attr_Header.ContentLength > 4194304
58+
self.Attr_Header.ContentOffset > 0x400000
59+
or self.Attr_Header.ContentLength > 0x400000
5860
):
5961
return None
6062

0 commit comments

Comments
 (0)