mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-09-28 12:34:53 +02:00
Add in a trivial renderer for testing the output system.
This commit is contained in:
@@ -8,6 +8,7 @@ from volatility.cli import argparse_adapter
|
||||
from volatility.framework import plugins, contexts
|
||||
from volatility.framework.configuration import depresolver
|
||||
from volatility.framework.configuration.depresolver import DependencyError
|
||||
from volatility.framework.renderers.text import TextRenderer
|
||||
|
||||
__author__ = 'mike'
|
||||
|
||||
@@ -53,7 +54,7 @@ class CommandLine(object):
|
||||
config_path = plugin.__name__.lower()
|
||||
if dldr.validate_dependencies(dependencies, context = ctx, path = config_path):
|
||||
# Construct and run the plugin
|
||||
plugin(ctx, config_path).run()
|
||||
TextRenderer().render(plugin(ctx, config_path).run())
|
||||
else:
|
||||
raise DependencyError("Unable to validate all the dependencies, please check configuration parameters")
|
||||
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
from volatility.framework import interfaces
|
||||
|
||||
|
||||
class TextRenderer(interfaces.renderers.Renderer):
|
||||
def __init__(self, options = None):
|
||||
pass
|
||||
|
||||
def get_render_options(self):
|
||||
pass
|
||||
|
||||
def render(self, grid):
|
||||
for row in grid.populate():
|
||||
print("\t".join(row))
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import volatility.framework.interfaces.plugins as plugins
|
||||
from volatility.framework.configuration import requirements
|
||||
from volatility.framework.renderers import TreeGrid
|
||||
|
||||
|
||||
class PsList(plugins.PluginInterface):
|
||||
@@ -32,6 +33,11 @@ class PsList(plugins.PluginInterface):
|
||||
# Get the process from the thread object in kernel space
|
||||
return ethread.owning_process()
|
||||
|
||||
def _generator(self, eproc):
|
||||
for proc in eproc.ActiveProcessLinks:
|
||||
print(proc.UniqueProcessId, proc.InheritedFromUniqueProcessId)
|
||||
yield (0, (proc.UniqueProcessId, proc.InheritedFromUniqueProcessId))
|
||||
|
||||
def run(self):
|
||||
|
||||
# Use the primary twice until we figure out how to specify base layers of a particular translation layer
|
||||
@@ -39,5 +45,7 @@ class PsList(plugins.PluginInterface):
|
||||
self.config['primary'],
|
||||
self.config['primary'],
|
||||
self.config['offset'])
|
||||
for proc in eproc.ActiveProcessLinks:
|
||||
print(proc.UniqueProcessId)
|
||||
|
||||
return TreeGrid([("PID", int),
|
||||
("PPID", int)],
|
||||
self._generator(eproc))
|
||||
|
||||
Reference in New Issue
Block a user