Skip to content

Commit f01310c

Browse files
committed
use search instead of match
1 parent 306b7ff commit f01310c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

volatility3/framework/plugins/regexscan.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def get_requirements(cls) -> List[interfaces.configuration.RequirementInterface]
4848

4949
def _generator(self, regex_pattern):
5050
regex_pattern = bytes(regex_pattern, "UTF-8")
51+
compiled_pattern = re.compile(regex_pattern)
5152
vollog.debug(f"RegEx Pattern: {regex_pattern}")
5253
maxsize = self.config.get("maxsize", self.MAXSIZE_DEFAULT)
5354
layer = self.context.layers[self.config["primary"]]
@@ -57,7 +58,7 @@ def _generator(self, regex_pattern):
5758
result_data = layer.read(offset, maxsize, pad=True)
5859

5960
# reapply the regex in order to extract just the match
60-
regex_result = re.match(regex_pattern, result_data)
61+
regex_result = compiled_pattern.search(result_data)
6162

6263
if regex_result:
6364
# the match is within the results_data (e.g. it fits within maxsize)

0 commit comments

Comments
 (0)