Skip to content

Commit df7b8a4

Browse files
committed
Layers: Fix up totally off values
1 parent 754bfe0 commit df7b8a4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

volatility3/framework/interfaces/layers.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -553,29 +553,27 @@ def _scan_iterator(
553553
for section_start, section_length in sections:
554554
output: List[Tuple[str, int, int]] = []
555555

556-
# Hold the offsets of each chunk (including how much has been filled)
557-
chunk_start = chunk_position = 0
558-
559556
# For each section, find out which bits of its exists and where they map to
560557
# This is faster than cutting the entire space into scan_chunk sized blocks and then
561558
# finding out what exists (particularly if most of the space isn't mapped)
559+
562560
for mapped in self.mapping(
563561
section_start, section_length, ignore_errors=True
564562
):
565563
offset, sublength, mapped_offset, mapped_length, layer_name = mapped
566564

567565
for block_start in range(
568-
mapped_offset, mapped_offset + mapped_length, scanner.chunk_size
566+
offset, offset + sublength, scanner.chunk_size
569567
):
570568
block_end = min(
571-
mapped_offset + mapped_length,
569+
offset + sublength,
572570
block_start + scanner.chunk_size + scanner.overlap,
573571
)
574-
output += [(self.name, block_start, block_end)]
572+
output += [(self.name, block_start, block_end - block_start)]
575573

576574
# Ship anything that might be left
577575
if output:
578-
yield output, mapped_offset
576+
yield output, offset
579577

580578

581579
class LayerContainer(collections.abc.Mapping):

0 commit comments

Comments
 (0)