From 79cf0412831efc453766aaeef88187cab1655c8c Mon Sep 17 00:00:00 2001 From: mtressler <59582863+mtressler@users.noreply.github.com> Date: Tue, 21 Jul 2020 16:45:00 -0400 Subject: [PATCH] Update check_modules.py Removed unnecessary header info. A symbol table without the module_kset struct will now raise a TypeError --- .../framework/plugins/linux/check_modules.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/volatility/framework/plugins/linux/check_modules.py b/volatility/framework/plugins/linux/check_modules.py index 8eb6fe964..be4890638 100644 --- a/volatility/framework/plugins/linux/check_modules.py +++ b/volatility/framework/plugins/linux/check_modules.py @@ -1,14 +1,7 @@ -# Volatility - # This file is Copyright 2020 Volatility Foundation and licensed under the Volatility Software License 1.0 # which is available at https://www.volatilityfoundation.org/license/vsl-v1.0 # -""" -@author: Matt Tressler -@contact: matthewtressler10@gmail.com -""" - import logging from typing import List @@ -45,11 +38,10 @@ class check_modules(plugins.PluginInterface): try: module_kset = vmlinux.object_from_symbol("module_kset") except exceptions.SymbolError: - vollog.error("this command is not supported by this profile") - return + module_kset = None if not module_kset: - vollog.error("this command is not supported by this profile") + raise TypeError("This plugin requires the module_kset structure. This structure is not present in the supplied symbol table. This means you are either analyzing an unsupported kernel version or that your symbol table is corrupt.") ret = {} @@ -84,4 +76,4 @@ class check_modules(plugins.PluginInterface): def run(self): return renderers.TreeGrid([("Module Address", format_hints.Hex), - ("Module Name", str)], self._generator()) \ No newline at end of file + ("Module Name", str)], self._generator())