Skip to content

Commit 4149c55

Browse files
authored
Merge pull request #1293 from volatilityfoundation/1292-dumpfiles-uses-incorrect-sector-size-for-datasectionobject
#1292 - use correct sector size for DataSectionObject file dumping
2 parents 9bda20d + bb5a447 commit 4149c55

File tree

1 file changed

+10
-1
lines changed
  • volatility3/framework/symbols/windows/extensions

1 file changed

+10
-1
lines changed

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,6 +1247,15 @@ def get_available_pages(self) -> Iterable[Tuple[int, int, int]]:
12471247
is_64bit = symbols.symbol_table_is_64bit(self._context, symbol_table_name)
12481248
is_pae = self._context.layers[self.vol.layer_name].metadata.get("pae", False)
12491249

1250+
# the sector_size is used as a multiplier to the StartingSector
1251+
# within each _SUBSECTION. ImageSectionObjects use a multiplier
1252+
# of 0x200 corresponding to sector alignment on disk,
1253+
# while DataSectionObjects use a multiplier of 0x1000 corresponding
1254+
# to the size of a page
1255+
sector_size = 0x200
1256+
if self.u.Flags.Image != 1:
1257+
sector_size = 0x1000
1258+
12501259
# This is a null-terminated single-linked list.
12511260
while subsection != 0:
12521261
try:
@@ -1257,7 +1266,7 @@ def get_available_pages(self) -> Iterable[Tuple[int, int, int]]:
12571266

12581267
# The offset into the file is stored implicitly based on the PTE location within the Subsection.
12591268
starting_sector = subsection.StartingSector
1260-
subsection_offset = starting_sector * 0x200
1269+
subsection_offset = starting_sector * sector_size
12611270

12621271
# Similar to the check in is_valid(), make sure the SubsectionBase is not page aligned.
12631272
# if subsection.SubsectionBase & self.PAGE_MASK == 0:

0 commit comments

Comments
 (0)