From 6b973f1538086a39766e667be5f89aa2f447c26c Mon Sep 17 00:00:00 2001 From: Mike Auty Date: Sun, 18 Dec 2016 02:19:46 +0000 Subject: [PATCH] Expose VolTemplateProxy.vol values in the Proxy (to allow for enumeration access in a template). --- volatility/framework/interfaces/objects.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/volatility/framework/interfaces/objects.py b/volatility/framework/interfaces/objects.py index d70e34e59..1003f5601 100644 --- a/volatility/framework/interfaces/objects.py +++ b/volatility/framework/interfaces/objects.py @@ -167,6 +167,12 @@ class Template(validity.ValidityRoutines): """Updates the keyword arguments""" self._vol.update(new_arguments) + def __getattr__(self, attr): + """Exposes any other values stored in ._vol as attributes (for example, enumeration choices)""" + if attr in self._vol: + return self._vol[attr] + raise AttributeError("{} object has no attribute {}".format(self.__class__.__name__, attr)) + def __call__(self, context, object_info): """Constructs the object