Skip to content

Commit

Permalink
Volshell: rename regex_scan short hand to rx so that it does not clas…
Browse files Browse the repository at this point in the history
…h with the built in python re module
  • Loading branch information
eve-mem committed Nov 13, 2024
1 parent 780f9ab commit af7a420
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions volatility3/cli/volshell/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def construct_locals(self) -> List[Tuple[List[str], Any]]:
(["cc", "create_configurable"], self.create_configurable),
(["lf", "load_file"], self.load_file),
(["rs", "run_script"], self.run_script),
(["re", "regex_scan"], self.regex_scan),
(["rx", "regex_scan"], self.regex_scan),
]

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

0 comments on commit af7a420

Please sign in to comment.