Skip to content

Commit af7a420

Browse files
committed
Volshell: rename regex_scan short hand to rx so that it does not clash with the built in python re module
1 parent 780f9ab commit af7a420

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

volatility3/cli/volshell/generic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def construct_locals(self) -> List[Tuple[List[str], Any]]:
149149
(["cc", "create_configurable"], self.create_configurable),
150150
(["lf", "load_file"], self.load_file),
151151
(["rs", "run_script"], self.run_script),
152-
(["re", "regex_scan"], self.regex_scan),
152+
(["rx", "regex_scan"], self.regex_scan),
153153
]
154154

155155
def _construct_locals_dict(self) -> Dict[str, Any]:
@@ -292,7 +292,7 @@ def display_words(self, offset, count=128, layer_name=None):
292292
def regex_scan(self, pattern, count=128, layer_name=None):
293293
"""Scans for regex pattern in layer using RegExScanner."""
294294
if not isinstance(pattern, bytes):
295-
raise TypeError("pattern must be bytes, e.g. re(b'pattern')")
295+
raise TypeError("pattern must be bytes, e.g. rx(b'pattern')")
296296
layer_name_to_scan = layer_name or self.current_layer
297297
for offset in self.context.layers[layer_name_to_scan].scan(
298298
scanner=scanners.RegExScanner(pattern),

0 commit comments

Comments
 (0)