mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-13 21:27:39 +02:00
Refactor create_filter to create_pid_filter.
This commit is contained in:
@@ -100,7 +100,7 @@ class Bash(plugins.PluginInterface, timeliner.TimeLinerInterface):
|
||||
yield (0, (int(task.p_pid), task_name, hist.get_time_object(), hist.get_command()))
|
||||
|
||||
def run(self):
|
||||
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
|
||||
filter_func = pslist.PsList.create_pid_filter([self.config.get('pid', None)])
|
||||
|
||||
return renderers.TreeGrid([("PID", int), ("Process", str), ("CommandTime", datetime.datetime),
|
||||
("Command", str)],
|
||||
@@ -112,7 +112,7 @@ class Bash(plugins.PluginInterface, timeliner.TimeLinerInterface):
|
||||
filter_func = filter_func)))
|
||||
|
||||
def generate_timeline(self):
|
||||
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
|
||||
filter_func = pslist.PsList.create_pid_filter([self.config.get('pid', None)])
|
||||
|
||||
for row in self._generator(
|
||||
pslist.PsList.list_tasks(
|
||||
|
||||
@@ -77,7 +77,7 @@ class Malfind(interfaces_plugins.PluginInterface):
|
||||
vma.get_perms(), format_hints.HexBytes(data), disasm))
|
||||
|
||||
def run(self):
|
||||
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
|
||||
filter_func = pslist.PsList.create_pid_filter([self.config.get('pid', None)])
|
||||
|
||||
return renderers.TreeGrid([("PID", int), ("Process", str), ("Start", format_hints.Hex),
|
||||
("End", format_hints.Hex), ("Protection", str), ("Hexdump", format_hints.HexBytes),
|
||||
|
||||
@@ -68,7 +68,7 @@ class Netstat(plugins.PluginInterface):
|
||||
def run(self):
|
||||
# mac.MacUtilities.aslr_mask_symbol_table(self.config, self.context)
|
||||
|
||||
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
|
||||
filter_func = pslist.PsList.create_pid_filter([self.config.get('pid', None)])
|
||||
|
||||
return renderers.TreeGrid([("Offset", format_hints.Hex), ("Proto", str), ("Local IP", str), ("Local Port", int),
|
||||
("Remote IP", str), ("Remote Port", int), ("State", str), ("Process", str)],
|
||||
|
||||
@@ -100,7 +100,7 @@ class Psaux(plugins.PluginInterface):
|
||||
yield (0, (task.p_pid, task_name, task.p_argc, args_str))
|
||||
|
||||
def run(self) -> renderers.TreeGrid:
|
||||
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
|
||||
filter_func = pslist.PsList.create_pid_filter([self.config.get('pid', None)])
|
||||
|
||||
return renderers.TreeGrid([("PID", int), ("Process", str), ("Argc", int), ("Arguments", str)],
|
||||
self._generator(
|
||||
|
||||
@@ -42,7 +42,7 @@ class PsList(interfaces_plugins.PluginInterface):
|
||||
]
|
||||
|
||||
@classmethod
|
||||
def create_filter(cls, pid_list: List[int] = None) -> Callable[[int], bool]:
|
||||
def create_pid_filter(cls, pid_list: List[int] = None) -> Callable[[int], bool]:
|
||||
|
||||
filter_func = lambda _: False
|
||||
# FIXME: mypy #4973 or #2608
|
||||
@@ -61,7 +61,7 @@ class PsList(interfaces_plugins.PluginInterface):
|
||||
self.context,
|
||||
self.config['primary'],
|
||||
self.config['darwin'],
|
||||
filter_func = self.create_filter([self.config.get('pid', None)])):
|
||||
filter_func = self.create_pid_filter([self.config.get('pid', None)])):
|
||||
pid = task.p_pid
|
||||
ppid = task.p_ppid
|
||||
name = utility.array_to_string(task.p_comm)
|
||||
|
||||
Reference in New Issue
Block a user