mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-11 12:17:38 +02:00
Fix up linuxutils to use symbol_tables rather than hard coded values
This commit is contained in:
@@ -228,8 +228,7 @@ class LinuxUtilities(object):
|
||||
return ret
|
||||
|
||||
@classmethod
|
||||
def files_descriptors_for_process(cls, config: interfaces.configuration.HierarchicalDict,
|
||||
context: interfaces.context.ContextInterface,
|
||||
def files_descriptors_for_process(cls, context: interfaces.context.ContextInterface, symbol_table: str,
|
||||
task: interfaces.objects.ObjectInterface):
|
||||
|
||||
fd_table = task.files.get_fds()
|
||||
@@ -242,7 +241,7 @@ class LinuxUtilities(object):
|
||||
if max_fds > 500000:
|
||||
return
|
||||
|
||||
file_type = config["vmlinux"] + constants.BANG + 'file'
|
||||
file_type = symbol_table + constants.BANG + 'file'
|
||||
|
||||
fds = objects.utility.array_of_pointers(fd_table, count = max_fds, subtype = file_type, context = context)
|
||||
|
||||
|
||||
@@ -30,12 +30,18 @@ class Lsof(plugins.PluginInterface):
|
||||
]
|
||||
|
||||
def _generator(self, tasks):
|
||||
symbol_table = None
|
||||
for task in tasks:
|
||||
if symbol_table is None:
|
||||
if constants.BANG not in task.vol.type_name:
|
||||
raise ValueError("Task is not part of a symbol table")
|
||||
symbol_table = task.vol.type_name.split(constants.BANG)[0]
|
||||
|
||||
name = utility.array_to_string(task.comm)
|
||||
pid = int(task.pid)
|
||||
|
||||
for fd_num, _, full_path in linux.LinuxUtilities.files_descriptors_for_process(
|
||||
self.config, self.context, task):
|
||||
self.context, symbol_table, task):
|
||||
yield (0, (pid, name, fd_num, full_path))
|
||||
|
||||
def run(self):
|
||||
|
||||
Reference in New Issue
Block a user