mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-23 01:54:51 +02:00
Rename filt to filter_func (because we value clarity over brevity) and another small fix.
This commit is contained in:
@@ -79,20 +79,21 @@ class Bash(plugins.PluginInterface, timeliner.TimeLinerInterface):
|
||||
yield (0, (task.pid, task_name, hist.get_time_object(), hist.get_command()))
|
||||
|
||||
def run(self):
|
||||
filt = pslist.PsList.create_filter([self.config.get('pid', None)])
|
||||
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
|
||||
|
||||
plugin = pslist.PsList.list_tasks
|
||||
|
||||
return renderers.TreeGrid(
|
||||
[("PID", int), ("Process", str), ("CommandTime", datetime.datetime), ("Command", str)],
|
||||
self._generator(plugin(self.context, self.config['primary'], self.config['vmlinux'], filter = filt)))
|
||||
self._generator(plugin(self.context, self.config['primary'], self.config['vmlinux'], filter = filter_func)))
|
||||
|
||||
def generate_timeline(self):
|
||||
filt = pslist.PsList.create_filter([self.config.get('pid', None)])
|
||||
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
|
||||
|
||||
plugin = pslist.PsList.list_tasks
|
||||
|
||||
for row in self._generator(plugin(self.context, self.config['primary'], self.config['vmlinux'], filter = filt)):
|
||||
for row in self._generator(
|
||||
plugin(self.context, self.config['primary'], self.config['vmlinux'], filter = filter_func)):
|
||||
_depth, row_data = row
|
||||
description = "{} ({}): \"{}\"".format(row_data[0], row_data[1], row_data[3])
|
||||
yield (description, timeliner.TimeLinerType.CREATED, row_data[2])
|
||||
|
||||
@@ -43,11 +43,11 @@ class Elfs(plugins.PluginInterface):
|
||||
yield (0, (task.pid, name, format_hints.Hex(vma.vm_start), format_hints.Hex(vma.vm_end), path))
|
||||
|
||||
def run(self):
|
||||
filt = pslist.PsList.create_filter([self.config.get('pid', None)])
|
||||
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
|
||||
|
||||
plugin = pslist.PsList.list_tasks
|
||||
|
||||
return renderers.TreeGrid(
|
||||
[("PID", int), ("Process", str), ("Start", format_hints.Hex), ("End", format_hints.Hex),
|
||||
("File Path", str)],
|
||||
self._generator(plugin(self.context, self.config['primary'], self.config['vmlinux'], filter = filt)))
|
||||
self._generator(plugin(self.context, self.config['primary'], self.config['vmlinux'], filter = filter_func)))
|
||||
|
||||
@@ -59,11 +59,11 @@ class Malfind(interfaces_plugins.PluginInterface):
|
||||
vma.get_protection(), format_hints.HexBytes(data), disasm))
|
||||
|
||||
def run(self):
|
||||
filt = pslist.PsList.create_filter([self.config.get('pid', None)])
|
||||
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
|
||||
|
||||
plugin = pslist.PsList.list_tasks
|
||||
|
||||
return renderers.TreeGrid(
|
||||
[("PID", int), ("Process", str), ("Start", format_hints.Hex), ("End", format_hints.Hex),
|
||||
("Protection", str), ("Hexdump", format_hints.HexBytes), ("Disasm", interfaces_renderers.Disassembly)],
|
||||
self._generator(plugin(self.context, self.config['primary'], self.config['vmlinux'], filter = filt)))
|
||||
self._generator(plugin(self.context, self.config['primary'], self.config['vmlinux'], filter = filter_func)))
|
||||
|
||||
@@ -90,11 +90,12 @@ class Bash(plugins.PluginInterface, timeliner.TimeLinerInterface):
|
||||
self._generator(plugin(self.context, self.config['primary'], self.config['darwin'], filter = filter)))
|
||||
|
||||
def generate_timeline(self):
|
||||
filt = pslist.PsList.create_filter([self.config.get('pid', None)])
|
||||
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
|
||||
|
||||
plugin = pslist.PsList.list_tasks
|
||||
|
||||
for row in self._generator(plugin(self.context, self.config['primary'], self.config['darwin'], filter = filt)):
|
||||
for row in self._generator(
|
||||
plugin(self.context, self.config['primary'], self.config['darwin'], filter = filter_func)):
|
||||
_depth, row_data = row
|
||||
description = "{} ({}): \"{}\"".format(row_data[0], row_data[1], row_data[3])
|
||||
yield (description, timeliner.TimeLinerType.CREATED, row_data[2])
|
||||
|
||||
@@ -57,11 +57,11 @@ class Malfind(interfaces_plugins.PluginInterface):
|
||||
vma.get_perms(), format_hints.HexBytes(data), disasm))
|
||||
|
||||
def run(self):
|
||||
filt = pslist.PsList.create_filter([self.config.get('pid', None)])
|
||||
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
|
||||
|
||||
plugin = pslist.PsList.list_tasks
|
||||
|
||||
return renderers.TreeGrid(
|
||||
[("PID", int), ("Process", str), ("Start", format_hints.Hex), ("End", format_hints.Hex),
|
||||
("Protection", str), ("Hexdump", format_hints.HexBytes), ("Disasm", interfaces_renderers.Disassembly)],
|
||||
self._generator(plugin(self.context, self.config['primary'], self.config['darwin'], filter = filt)))
|
||||
self._generator(plugin(self.context, self.config['primary'], self.config['darwin'], filter = filter_func)))
|
||||
|
||||
@@ -81,10 +81,10 @@ class Psaux(plugins.PluginInterface):
|
||||
yield (0, (task.p_pid, task_name, task.p_argc, args_str))
|
||||
|
||||
def run(self) -> renderers.TreeGrid:
|
||||
filt = pslist.PsList.create_filter([self.config.get('pid', None)])
|
||||
filter_func = pslist.PsList.create_filter([self.config.get('pid', None)])
|
||||
|
||||
plugin = pslist.PsList.list_tasks
|
||||
|
||||
return renderers.TreeGrid(
|
||||
[("PID", int), ("Process", str), ("Argc", int), ("Arguments", str)],
|
||||
self._generator(plugin(self.context, self.config['primary'], self.config['darwin'], filter = filt)))
|
||||
self._generator(plugin(self.context, self.config['primary'], self.config['darwin'], filter = filter_func)))
|
||||
|
||||
@@ -27,7 +27,7 @@ class PsList(interfaces_plugins.PluginInterface):
|
||||
def nullfilter():
|
||||
return False
|
||||
|
||||
filt = nullfilter
|
||||
filter_func = nullfilter
|
||||
# FIXME: mypy #4973 or #2608
|
||||
pid_list = pid_list or []
|
||||
filter_list = [x for x in pid_list if x is not None]
|
||||
@@ -36,8 +36,8 @@ class PsList(interfaces_plugins.PluginInterface):
|
||||
def list_filter(x):
|
||||
return x not in filter_list
|
||||
|
||||
filt = list_filter
|
||||
return filt
|
||||
filter_func = list_filter
|
||||
return filter_func
|
||||
|
||||
def _generator(self):
|
||||
for task in self.list_tasks(
|
||||
|
||||
@@ -22,7 +22,7 @@ class PsTree(plugins.PluginInterface):
|
||||
requirements.SymbolRequirement(name = "darwin", description = "Mac Kernel")
|
||||
]
|
||||
|
||||
def find_level(self, pid):
|
||||
def _find_level(self, pid):
|
||||
"""Finds how deep the pid is in the processes list"""
|
||||
seen = set([])
|
||||
seen.add(pid)
|
||||
@@ -44,7 +44,7 @@ class PsTree(plugins.PluginInterface):
|
||||
|
||||
# Build the child/level maps
|
||||
for pid in self._processes:
|
||||
self.find_level(pid)
|
||||
self._find_level(pid)
|
||||
|
||||
def yield_processes(pid):
|
||||
proc = self._processes[pid]
|
||||
|
||||
Reference in New Issue
Block a user